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

Method test_send_file

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

Source from the content-addressed store, hash-verified

990 r"got more than \d+ headers", r.begin)
991
992 def test_send_file(self):
993 expected = (b'GET /foo HTTP/1.1\r\nHost: example.com\r\n'
994 b'Accept-Encoding: identity\r\n'
995 b'Transfer-Encoding: chunked\r\n'
996 b'\r\n')
997
998 with open(__file__, 'rb') as body:
999 conn = client.HTTPConnection('example.com')
1000 sock = FakeSocket(body)
1001 conn.sock = sock
1002 conn.request('GET', '/foo', body)
1003 self.assertStartsWith(sock.data, expected)
1004
1005 def test_send(self):
1006 expected = b'this is a test this is only a test'

Callers

nothing calls this directly

Calls 4

requestMethod · 0.95
FakeSocketClass · 0.70
openFunction · 0.50
assertStartsWithMethod · 0.45

Tested by

no test coverage detected