Check that send() respects the configured block size.
(self)
| 1066 | self.assertEqual(body, expected) |
| 1067 | |
| 1068 | def test_blocksize_send(self): |
| 1069 | """Check that send() respects the configured block size.""" |
| 1070 | blocksize = 8 # For easy debugging. |
| 1071 | conn = client.HTTPConnection('example.com', blocksize=blocksize) |
| 1072 | sock = FakeSocket(None) |
| 1073 | conn.sock = sock |
| 1074 | expected = b"a" * blocksize + b"b" |
| 1075 | conn.send(io.BytesIO(expected)) |
| 1076 | self.assertEqual(sock.sendall_calls, 2) |
| 1077 | self.assertEqual(sock.data, expected) |
| 1078 | |
| 1079 | def test_send_type_error(self): |
| 1080 | # See: Issue #12676 |
nothing calls this directly
no test coverage detected