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

Method test_send_iter

Lib/test/test_httplib.py:1040–1054  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1038
1039
1040 def test_send_iter(self):
1041 expected = b'GET /foo HTTP/1.1\r\nHost: example.com\r\n' \
1042 b'Accept-Encoding: identity\r\nContent-Length: 11\r\n' \
1043 b'\r\nonetwothree'
1044
1045 def body():
1046 yield b"one"
1047 yield b"two"
1048 yield b"three"
1049
1050 conn = client.HTTPConnection('example.com')
1051 sock = FakeSocket("")
1052 conn.sock = sock
1053 conn.request('GET', '/foo', body(), {'Content-Length': '11'})
1054 self.assertEqual(sock.data, expected)
1055
1056 def test_blocksize_request(self):
1057 """Check that request() respects the configured block size."""

Callers

nothing calls this directly

Calls 3

requestMethod · 0.95
FakeSocketClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected