MCPcopy Index your code
hub / github.com/python/cpython / test_blocksize_send

Method test_blocksize_send

Lib/test/test_httplib.py:1114–1123  ·  view source on GitHub ↗

Check that send() respects the configured block size.

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

sendMethod · 0.95
FakeSocketClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected