Check that request() respects the configured block size.
(self)
| 1100 | self.assertEqual(sock.data, expected) |
| 1101 | |
| 1102 | def test_blocksize_request(self): |
| 1103 | """Check that request() respects the configured block size.""" |
| 1104 | blocksize = 8 # For easy debugging. |
| 1105 | conn = client.HTTPConnection('example.com', blocksize=blocksize) |
| 1106 | sock = FakeSocket(None) |
| 1107 | conn.sock = sock |
| 1108 | expected = b"a" * blocksize + b"b" |
| 1109 | conn.request("PUT", "/", io.BytesIO(expected), {"Content-Length": "9"}) |
| 1110 | self.assertEqual(sock.sendall_calls, 3) |
| 1111 | body = sock.data.split(b"\r\n\r\n", 1)[1] |
| 1112 | self.assertEqual(body, expected) |
| 1113 | |
| 1114 | def test_blocksize_send(self): |
| 1115 | """Check that send() respects the configured block size.""" |
nothing calls this directly
no test coverage detected