diff tests/suite_11_hidden/__init__.py @ 71:88adf10be709 draft

Add tests.
author David Barts <n5jrn@me.com>
date Mon, 15 Jul 2019 13:16:31 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/suite_11_hidden/__init__.py	Mon Jul 15 13:16:31 2019 -0700
@@ -0,0 +1,24 @@
+# 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_hidden(self):
+        response = requests.get("http://localhost:{0}/hidden.pspx".format(self.port))
+        self.assertEqual(response.status_code, 404)
+
+    # Relative, with .
+    def test_02_not_hidden(self):
+        response = requests.get("http://localhost:{0}/nothidden.pspx".format(self.port))
+        self.assertEqual(response.status_code, 200)
+
+    # Relative, with ..
+    def test_03_forward(self):
+        response = requests.get("http://localhost:{0}/forward.pspx".format(self.port))
+        self.assertEqual(response.status_code, 200)
+        self.assertTrue("Hello, World (Hidden)" in response.text)