(self)
| 1038 | |
| 1039 | |
| 1040 | def test_send_iter(self): |
| 1041 | expected = b'GET /foo HTTP/1.1\r\nHost: example.com\r\n' \ |
| 1042 | b'Accept-Encoding: identity\r\nContent-Length: 11\r\n' \ |
| 1043 | b'\r\nonetwothree' |
| 1044 | |
| 1045 | def body(): |
| 1046 | yield b"one" |
| 1047 | yield b"two" |
| 1048 | yield b"three" |
| 1049 | |
| 1050 | conn = client.HTTPConnection('example.com') |
| 1051 | sock = FakeSocket("") |
| 1052 | conn.sock = sock |
| 1053 | conn.request('GET', '/foo', body(), {'Content-Length': '11'}) |
| 1054 | self.assertEqual(sock.data, expected) |
| 1055 | |
| 1056 | def test_blocksize_request(self): |
| 1057 | """Check that request() respects the configured block size.""" |
nothing calls this directly
no test coverage detected