view tests/suite_03_good_forward/__init__.py @ 72:e8b3b336e63e draft default tip

Update version.
author David Barts <n5jrn@me.com>
date Mon, 15 Jul 2019 13:17:48 -0700
parents 88adf10be709
children
line wrap: on
line source

# I m p o r t s

import os, sys
import requests
from .. import ServerFixture, RoutesFixture

# C l a s s e s

class Fixture01(RoutesFixture):
    # Same directory
    def test_01_same(self):
        response = requests.get("http://localhost:{0}/same.pspx".format(self.port))
        self.assertEqual(response.status_code, 200)
        self.assertTrue("This is the original page." in response.text)

    # Relative, with .
    def test_02_relative_dot(self):
        response = requests.get("http://localhost:{0}/relative.pspx".format(self.port))
        self.assertEqual(response.status_code, 200)
        self.assertTrue("This is the original page." in response.text)

    # Relative, with ..
    def test_03_relative_dotdot(self):
        response = requests.get("http://localhost:{0}/subdir/relative.pspx".format(self.port))
        self.assertEqual(response.status_code, 200)
        self.assertTrue("This is the original page." in response.text)

    # Absolute
    def test_04_absolute(self):
        response = requests.get("http://localhost:{0}/subdir/absolute.pspx".format(self.port))
        self.assertEqual(response.status_code, 200)
        self.assertTrue("This is the original page." in response.text)