MCPcopy
hub / github.com/encode/httpx / test_json

Function test_json

tests/test_main.py:39–53  ·  view source on GitHub ↗
(server)

Source from the content-addressed store, hash-verified

37
38
39def test_json(server):
40 url = str(server.url.copy_with(path="/json"))
41 runner = CliRunner()
42 result = runner.invoke(httpx.main, [url])
43 assert result.exit_code == 0
44 assert remove_date_header(splitlines(result.output)) == [
45 "HTTP/1.1 200 OK",
46 "server: uvicorn",
47 "content-type: application/json",
48 "Transfer-Encoding: chunked",
49 "",
50 "{",
51 '"Hello": "world!"',
52 "}",
53 ]
54
55
56def test_binary(server):

Callers

nothing calls this directly

Calls 3

remove_date_headerFunction · 0.85
splitlinesFunction · 0.85
copy_withMethod · 0.45

Tested by

no test coverage detected