mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Test directory redirect.
This commit is contained in:
parent
862e3ac124
commit
22b4dac09b
@ -151,6 +151,21 @@ def setUpModule():
|
||||
]:
|
||||
makeSimpleCases(*args)
|
||||
|
||||
class TestDirRedirect(TestHelper):
|
||||
def setUp(self):
|
||||
self.url = "/mydir"
|
||||
self.fn = WWWROOT + self.url
|
||||
os.mkdir(self.fn)
|
||||
|
||||
def tearDown(self):
|
||||
os.rmdir(self.fn)
|
||||
|
||||
def test_dir_redirect(self):
|
||||
resp = Conn().get(self.url)
|
||||
status, hdrs, body = parse(resp)
|
||||
self.assertContains(status, "301 Moved Permanently")
|
||||
self.assertEquals(hdrs["Location"], self.url+"/") # trailing slash
|
||||
|
||||
class TestFileGet(TestHelper):
|
||||
def setUp(self):
|
||||
self.datalen = 2345
|
||||
|
Loading…
Reference in New Issue
Block a user