Check that request() respects the configured block size.
(self)
| 1054 | self.assertEqual(sock.data, expected) |
| 1055 | |
| 1056 | def test_blocksize_request(self): |
| 1057 | """Check that request() respects the configured block size.""" |
| 1058 | blocksize = 8 # For easy debugging. |
| 1059 | conn = client.HTTPConnection('example.com', blocksize=blocksize) |
| 1060 | sock = FakeSocket(None) |
| 1061 | conn.sock = sock |
| 1062 | expected = b"a" * blocksize + b"b" |
| 1063 | conn.request("PUT", "/", io.BytesIO(expected), {"Content-Length": "9"}) |
| 1064 | self.assertEqual(sock.sendall_calls, 3) |
| 1065 | body = sock.data.split(b"\r\n\r\n", 1)[1] |
| 1066 | self.assertEqual(body, expected) |
| 1067 | |
| 1068 | def test_blocksize_send(self): |
| 1069 | """Check that send() respects the configured block size.""" |
nothing calls this directly
no test coverage detected