Check that send() respects the configured block size.
(self)
| 1112 | self.assertEqual(body, expected) |
| 1113 | |
| 1114 | def test_blocksize_send(self): |
| 1115 | """Check that send() respects the configured block size.""" |
| 1116 | blocksize = 8 # For easy debugging. |
| 1117 | conn = client.HTTPConnection('example.com', blocksize=blocksize) |
| 1118 | sock = FakeSocket(None) |
| 1119 | conn.sock = sock |
| 1120 | expected = b"a" * blocksize + b"b" |
| 1121 | conn.send(io.BytesIO(expected)) |
| 1122 | self.assertEqual(sock.sendall_calls, 2) |
| 1123 | self.assertEqual(sock.data, expected) |
| 1124 | |
| 1125 | def test_send_type_error(self): |
| 1126 | # See: Issue #12676 |
nothing calls this directly
no test coverage detected