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

Function test_post

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

Source from the content-addressed store, hash-verified

104
105
106def test_post(server):
107 url = str(server.url.copy_with(path="/echo_body"))
108 runner = CliRunner()
109 result = runner.invoke(httpx.main, [url, "-m", "POST", "-j", '{"hello": "world"}'])
110 assert result.exit_code == 0
111 assert remove_date_header(splitlines(result.output)) == [
112 "HTTP/1.1 200 OK",
113 "server: uvicorn",
114 "content-type: text/plain",
115 "Transfer-Encoding: chunked",
116 "",
117 '{"hello":"world"}',
118 ]
119
120
121def test_verbose(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