(self)
| 1417 | resp.close() |
| 1418 | |
| 1419 | def test_read1_bound_content_length(self): |
| 1420 | extradata = b"extradata" |
| 1421 | expected = b"Hello123\r\n" |
| 1422 | sock = FakeSocket(b'HTTP/1.1 200 OK\r\nContent-Length: 30\r\n\r\n' + expected*3 + extradata) |
| 1423 | resp = client.HTTPResponse(sock, method="GET") |
| 1424 | resp.begin() |
| 1425 | self.assertEqual(resp.read1(20), expected*2) |
| 1426 | self.assertEqual(resp.read(), expected) |
| 1427 | # the file should now have our extradata ready to be read |
| 1428 | self.assertEqual(sock.file.read(), extradata) #we read to the end |
| 1429 | resp.close() |
| 1430 | |
| 1431 | def test_response_fileno(self): |
| 1432 | # Make sure fd returned by fileno is valid. |
nothing calls this directly
no test coverage detected