diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-04-29 02:20:46 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-04-29 02:20:46 (GMT) |
commit | 9c29f86a81d159eaa7be47f0de7c78f7a88d78fd (patch) | |
tree | a208763ee55bf0420069132d2d67ed782444476d /Lib | |
parent | 285e51b7e025b3aae7149a4eaa544e937c6bb37e (diff) | |
download | cpython-9c29f86a81d159eaa7be47f0de7c78f7a88d78fd.zip cpython-9c29f86a81d159eaa7be47f0de7c78f7a88d78fd.tar.gz cpython-9c29f86a81d159eaa7be47f0de7c78f7a88d78fd.tar.bz2 |
httplib test for early eof response. related to Issue13684
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_httplib.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index ff03321..7c6c5bc 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -369,6 +369,15 @@ class BasicTest(TestCase): resp.begin() 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): def test_responses(self): self.assertEqual(client.responses[client.NOT_FOUND], "Not Found") |