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

Method test_send_iter

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

Source from the content-addressed store, hash-verified

1084
1085
1086 def test_send_iter(self):
1087 expected = b'GET /foo HTTP/1.1\r\nHost: example.com\r\n' \
1088 b'Accept-Encoding: identity\r\nContent-Length: 11\r\n' \
1089 b'\r\nonetwothree'
1090
1091 def body():
1092 yield b"one"
1093 yield b"two"
1094 yield b"three"
1095
1096 conn = client.HTTPConnection('example.com')
1097 sock = FakeSocket("")
1098 conn.sock = sock
1099 conn.request('GET', '/foo', body(), {'Content-Length': '11'})
1100 self.assertEqual(sock.data, expected)
1101
1102 def test_blocksize_request(self):
1103 """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