Commit 9c29f86a authored by Senthil Kumaran's avatar Senthil Kumaran

httplib test for early eof response. related to Issue13684

parent 285e51b7
...@@ -369,6 +369,15 @@ class BasicTest(TestCase): ...@@ -369,6 +369,15 @@ class BasicTest(TestCase):
resp.begin() resp.begin()
self.assertRaises(client.LineTooLong, resp.read) self.assertRaises(client.LineTooLong, resp.read)
def test_early_eof(self):
# Test httpresponse with no \r\n termination,
body = "HTTP/1.1 200 Ok"
sock = FakeSocket(body)
resp = client.HTTPResponse(sock)
resp.begin()
self.assertEqual(resp.read(), b'')
self.assertTrue(resp.isclosed())
class OfflineTest(TestCase): class OfflineTest(TestCase):
def test_responses(self): def test_responses(self):
self.assertEqual(client.responses[client.NOT_FOUND], "Not Found") self.assertEqual(client.responses[client.NOT_FOUND], "Not Found")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment