From c16f5c1007326522dfb9bc16443be2790829ae9c Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Mon, 17 Jan 2011 23:59:33 +1100 Subject: [PATCH] More tests. --- devel/test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/devel/test.py b/devel/test.py index e412f30..6a282d6 100755 --- a/devel/test.py +++ b/devel/test.py @@ -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, "/../")