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

Function test_post

tests/test_main.py:106–118  ·  tests/test_main.py::test_post
(server)

Source from the content-addressed store, hash-verified

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