Add test to exercise memove() in make_safe_url()
authorEmil Mikulic <emikulic@gmail.com>
Mon, 10 Jun 2013 09:26:25 +0000 (19:26 +1000)
committerEmil Mikulic <emikulic@gmail.com>
Mon, 10 Jun 2013 09:26:25 +0000 (19:26 +1000)
devel/test.py

index 031dc71..30f9e54 100755 (executable)
@@ -189,8 +189,8 @@ class TestFileGet(TestHelper):
     def tearDown(self):
         os.unlink(self.fn)
 
-    def test_file_get(self):
-        resp = Conn().get(self.url)
+    def get_helper(self, url):
+        resp = Conn().get(url)
         status, hdrs, body = parse(resp)
         self.assertContains(status, "200 OK")
         self.assertEquals(hdrs["Accept-Ranges"], "bytes")
@@ -199,6 +199,12 @@ class TestFileGet(TestHelper):
         self.assertContains(hdrs["Server"], "darkhttpd/")
         self.assertEquals(body, self.data)
 
+    def test_file_get(self):
+        self.get_helper(self.url)
+
+    def test_file_get_redundant_dots(self):
+        self.get_helper("/././." + self.url)
+
     def test_file_head(self):
         resp = Conn().get(self.url, method="HEAD")
         status, hdrs, body = parse(resp)