(self)
| 1463 | resp.close() |
| 1464 | |
| 1465 | def test_read1_bound_content_length(self): |
| 1466 | extradata = b"extradata" |
| 1467 | expected = b"Hello123\r\n" |
| 1468 | sock = FakeSocket(b'HTTP/1.1 200 OK\r\nContent-Length: 30\r\n\r\n' + expected*3 + extradata) |
| 1469 | resp = client.HTTPResponse(sock, method="GET") |
| 1470 | resp.begin() |
| 1471 | self.assertEqual(resp.read1(20), expected*2) |
| 1472 | self.assertEqual(resp.read(), expected) |
| 1473 | # the file should now have our extradata ready to be read |
| 1474 | self.assertEqual(sock.file.read(), extradata) #we read to the end |
| 1475 | resp.close() |
| 1476 | |
| 1477 | def test_response_fileno(self): |
| 1478 | # Make sure fd returned by fileno is valid. |
nothing calls this directly
no test coverage detected