71
|
1 # I m p o r t s
|
|
2
|
|
3 import os, sys
|
|
4 import requests
|
|
5 from .. import ServerFixture, RoutesFixture
|
|
6
|
|
7 # C l a s s e s
|
|
8
|
|
9 class Fixture01(RoutesFixture):
|
|
10 # Same directory
|
|
11 def test_01_same(self):
|
|
12 response = requests.get("http://localhost:{0}/same.pspx".format(self.port))
|
|
13 self.assertEqual(response.status_code, 200)
|
|
14 self.assertTrue("This is the original page." in response.text)
|
|
15
|
|
16 # Relative, with .
|
|
17 def test_02_relative_dot(self):
|
|
18 response = requests.get("http://localhost:{0}/relative.pspx".format(self.port))
|
|
19 self.assertEqual(response.status_code, 200)
|
|
20 self.assertTrue("This is the original page." in response.text)
|
|
21
|
|
22 # Relative, with ..
|
|
23 def test_03_relative_dotdot(self):
|
|
24 response = requests.get("http://localhost:{0}/subdir/relative.pspx".format(self.port))
|
|
25 self.assertEqual(response.status_code, 200)
|
|
26 self.assertTrue("This is the original page." in response.text)
|
|
27
|
|
28 # Absolute
|
|
29 def test_04_absolute(self):
|
|
30 response = requests.get("http://localhost:{0}/subdir/absolute.pspx".format(self.port))
|
|
31 self.assertEqual(response.status_code, 200)
|
|
32 self.assertTrue("This is the original page." in response.text)
|