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

Method test_http_client

Lib/test/test_httpservers.py:1532–1540  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1530 return self.parse_cli_output(line) == (protocol, bind, port)
1531
1532 def test_http_client(self):
1533 bind, port = '127.0.0.1', find_unused_port()
1534 proc = spawn_python('-u', '-m', 'http.server', str(port), '-b', bind,
1535 bufsize=1, text=True)
1536 self.addCleanup(kill_python, proc)
1537 self.addCleanup(proc.terminate)
1538 self.assertTrue(self.wait_for_server(proc, 'http', bind, port))
1539 res = self.fetch_file(f'http://{bind}:{port}/{self.served_filename}')
1540 self.assertEqual(res, self.served_data)
1541
1542 @unittest.skipIf(ssl is None, "requires ssl")
1543 def test_https_client(self):

Callers

nothing calls this directly

Calls 8

wait_for_serverMethod · 0.95
fetch_fileMethod · 0.95
find_unused_portFunction · 0.90
spawn_pythonFunction · 0.90
strFunction · 0.85
addCleanupMethod · 0.80
assertTrueMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected