diff --git a/devel/test.py b/devel/test.py index ad6163c..8aedb4d 100755 --- a/devel/test.py +++ b/devel/test.py @@ -72,13 +72,15 @@ class TestHelper(unittest.TestCase): 'Generated by darkhttpd') class TestDirList(TestHelper): + def setUp(self): + self.fn = WWWROOT+"/escape#this" + open(self.fn, "w").write("x"*12345) + + def tearDown(self): + os.unlink(self.fn) + def test_dirlist_escape(self): - fn = WWWROOT+"/escape#this" - open(fn, "w").write("x"*12345) - try: - resp = Conn().get("/") - finally: - os.unlink(fn) + resp = Conn().get("/") status, hdrs, body = parse(resp) self.assertEquals(ord("#"), 0x23) self.assertContains(body, "escape%23this", "12345")