(self)
| 832 | self.assertTrue(resp.closed) |
| 833 | |
| 834 | def test_mixed_reads(self): |
| 835 | # readline() should update the remaining length, so that read() knows |
| 836 | # how much data is left and does not raise IncompleteRead |
| 837 | body = "HTTP/1.1 200 Ok\r\nContent-Length: 13\r\n\r\nText\r\nAnother" |
| 838 | sock = FakeSocket(body) |
| 839 | resp = client.HTTPResponse(sock) |
| 840 | resp.begin() |
| 841 | self.assertEqual(resp.readline(), b'Text\r\n') |
| 842 | self.assertFalse(resp.isclosed()) |
| 843 | self.assertEqual(resp.read(), b'Another') |
| 844 | self.assertTrue(resp.isclosed()) |
| 845 | self.assertFalse(resp.closed) |
| 846 | resp.close() |
| 847 | self.assertTrue(resp.closed) |
| 848 | |
| 849 | def test_partial_readintos(self): |
| 850 | # if we have Content-Length, HTTPResponse knows when to close itself, |
nothing calls this directly
no test coverage detected