mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Failing test for If-Modified-Since
This commit is contained in:
parent
c7b65d1123
commit
a2eb59e928
|
@ -178,6 +178,19 @@ class TestFileGet(TestHelper):
|
||||||
self.assertEquals(hdrs["Content-Length"], str(self.datalen))
|
self.assertEquals(hdrs["Content-Length"], str(self.datalen))
|
||||||
self.assertEquals(hdrs["Content-Type"], "image/jpeg")
|
self.assertEquals(hdrs["Content-Type"], "image/jpeg")
|
||||||
|
|
||||||
|
def test_if_modified_since(self):
|
||||||
|
resp1 = Conn().get(self.url, method="HEAD")
|
||||||
|
status, hdrs, body = parse(resp1)
|
||||||
|
lastmod = hdrs["Last-Modified"]
|
||||||
|
|
||||||
|
resp2 = Conn().get(self.url, method="GET", req_hdrs =
|
||||||
|
{"If-Modified-Since": lastmod })
|
||||||
|
status, hdrs, body = parse(resp2)
|
||||||
|
self.assertContains(status, "304 Not Modified")
|
||||||
|
self.assertFalse(hdrs.has_key("Last-Modified"))
|
||||||
|
self.assertFalse(hdrs.has_key("Content-Length"))
|
||||||
|
self.assertFalse(hdrs.has_key("Content-Type"))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
setUpModule()
|
setUpModule()
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user