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

Function test_binary

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

Source from the content-addressed store, hash-verified

54
55
56def test_binary(server):
57 url = str(server.url.copy_with(path="/echo_binary"))
58 runner = CliRunner()
59 content = "Hello, world!"
60 result = runner.invoke(httpx.main, [url, "-c", content])
61 assert result.exit_code == 0
62 assert remove_date_header(splitlines(result.output)) == [
63 "HTTP/1.1 200 OK",
64 "server: uvicorn",
65 "content-type: application/octet-stream",
66 "Transfer-Encoding: chunked",
67 "",
68 f"<{len(content)} bytes of binary data>",
69 ]
70
71
72def test_redirects(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