(self)
| 1347 | self.assertRaises(client.LineTooLong, resp.read) |
| 1348 | |
| 1349 | def test_early_eof(self): |
| 1350 | # Test httpresponse with no \r\n termination, |
| 1351 | body = "HTTP/1.1 200 Ok" |
| 1352 | sock = FakeSocket(body) |
| 1353 | resp = client.HTTPResponse(sock) |
| 1354 | resp.begin() |
| 1355 | self.assertEqual(resp.read(), b'') |
| 1356 | self.assertTrue(resp.isclosed()) |
| 1357 | self.assertFalse(resp.closed) |
| 1358 | resp.close() |
| 1359 | self.assertTrue(resp.closed) |
| 1360 | |
| 1361 | def test_error_leak(self): |
| 1362 | # Test that the socket is not leaked if getresponse() fails |
nothing calls this directly
no test coverage detected