More tests.
authorEmil Mikulic <emikulic@gmail.com>
Mon, 17 Jan 2011 12:59:33 +0000 (23:59 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Sun, 28 Apr 2013 10:37:08 +0000 (20:37 +1000)
devel/test.py

index e412f30..6a282d6 100755 (executable)
@@ -56,6 +56,18 @@ class TestCases(unittest.TestCase):
         body = Conn().get("GET /dir/../ HTTP/1.0\n\n")
         self.assertIsIndex(body, "/dir/../")
 
+    def testExtraneousSlashes(self):
+        body = Conn().get("GET //dir///..//// HTTP/1.0\n\n")
+        self.assertIsIndex(body, "//dir///..////")
+
+    def testWithoutTrailingSlash(self):
+        body = Conn().get("GET /dir/.. HTTP/1.0\n\n")
+        self.assertIsIndex(body, "/dir/..")
+
+    def testWithoutLeadingSlashFails(self):
+        body = Conn().get("GET dir/../ HTTP/1.0\n\n")
+        self.assertIsInvalid(body, "dir/../")
+
     def testUpDirInvalid(self):
         body = Conn().get("GET /../ HTTP/1.0\n\n")
         self.assertIsInvalid(body, "/../")