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

Function test_redirects

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

Source from the content-addressed store, hash-verified

70
71
72def test_redirects(server):
73 url = str(server.url.copy_with(path="/redirect_301"))
74 runner = CliRunner()
75 result = runner.invoke(httpx.main, [url])
76 assert result.exit_code == 1
77 assert remove_date_header(splitlines(result.output)) == [
78 "HTTP/1.1 301 Moved Permanently",
79 "server: uvicorn",
80 "location: /",
81 "Transfer-Encoding: chunked",
82 "",
83 ]
84
85
86def test_follow_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