(self)
| 929 | self.assertTrue(resp.isclosed()) |
| 930 | |
| 931 | def test_partial_reads_incomplete_body(self): |
| 932 | # if the server shuts down the connection before the whole |
| 933 | # content-length is delivered, the socket is gracefully closed |
| 934 | body = "HTTP/1.1 200 Ok\r\nContent-Length: 10\r\n\r\nText" |
| 935 | sock = FakeSocket(body) |
| 936 | resp = client.HTTPResponse(sock) |
| 937 | resp.begin() |
| 938 | self.assertEqual(resp.read(2), b'Te') |
| 939 | self.assertFalse(resp.isclosed()) |
| 940 | self.assertEqual(resp.read(2), b'xt') |
| 941 | self.assertEqual(resp.read(1), b'') |
| 942 | self.assertTrue(resp.isclosed()) |
| 943 | |
| 944 | def test_partial_readintos_incomplete_body(self): |
| 945 | # if the server shuts down the connection before the whole |
nothing calls this directly
no test coverage detected