(self)
| 1301 | self.assertRaises(client.LineTooLong, resp.read) |
| 1302 | |
| 1303 | def test_early_eof(self): |
| 1304 | # Test httpresponse with no \r\n termination, |
| 1305 | body = "HTTP/1.1 200 Ok" |
| 1306 | sock = FakeSocket(body) |
| 1307 | resp = client.HTTPResponse(sock) |
| 1308 | resp.begin() |
| 1309 | self.assertEqual(resp.read(), b'') |
| 1310 | self.assertTrue(resp.isclosed()) |
| 1311 | self.assertFalse(resp.closed) |
| 1312 | resp.close() |
| 1313 | self.assertTrue(resp.closed) |
| 1314 | |
| 1315 | def test_error_leak(self): |
| 1316 | # Test that the socket is not leaked if getresponse() fails |
nothing calls this directly
no test coverage detected