(self)
| 1451 | resp.close() |
| 1452 | |
| 1453 | def test_readline_bound_content_length(self): |
| 1454 | extradata = b"extradata" |
| 1455 | expected = b"Hello123\r\n" |
| 1456 | sock = FakeSocket(b'HTTP/1.1 200 OK\r\nContent-Length: 10\r\n\r\n' + expected + extradata) |
| 1457 | resp = client.HTTPResponse(sock, method="GET") |
| 1458 | resp.begin() |
| 1459 | self.assertEqual(resp.readline(10), expected) |
| 1460 | self.assertEqual(resp.readline(10), b"") |
| 1461 | # the file should now have our extradata ready to be read |
| 1462 | self.assertEqual(sock.file.read(), extradata) #we read to the end |
| 1463 | resp.close() |
| 1464 | |
| 1465 | def test_read1_bound_content_length(self): |
| 1466 | extradata = b"extradata" |
nothing calls this directly
no test coverage detected