(self)
| 786 | self.assertTrue(resp.closed) |
| 787 | |
| 788 | def test_mixed_reads(self): |
| 789 | # readline() should update the remaining length, so that read() knows |
| 790 | # how much data is left and does not raise IncompleteRead |
| 791 | body = "HTTP/1.1 200 Ok\r\nContent-Length: 13\r\n\r\nText\r\nAnother" |
| 792 | sock = FakeSocket(body) |
| 793 | resp = client.HTTPResponse(sock) |
| 794 | resp.begin() |
| 795 | self.assertEqual(resp.readline(), b'Text\r\n') |
| 796 | self.assertFalse(resp.isclosed()) |
| 797 | self.assertEqual(resp.read(), b'Another') |
| 798 | self.assertTrue(resp.isclosed()) |
| 799 | self.assertFalse(resp.closed) |
| 800 | resp.close() |
| 801 | self.assertTrue(resp.closed) |
| 802 | |
| 803 | def test_partial_readintos(self): |
| 804 | # if we have Content-Length, HTTPResponse knows when to close itself, |
nothing calls this directly
no test coverage detected