MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_blocksize_send

Method test_blocksize_send

Lib/test/test_httplib.py:1068–1077  ·  view source on GitHub ↗

Check that send() respects the configured block size.

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

sendMethod · 0.95
FakeSocketClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected