MCPcopy
hub / github.com/httpie/cli / test_output_option

Function test_output_option

tests/test_output.py:33–44  ·  view source on GitHub ↗
(tmp_path, httpbin, stdout_isatty)

Source from the content-addressed store, hash-verified

31
32@pytest.mark.parametrize('stdout_isatty', [True, False])
33def test_output_option(tmp_path, httpbin, stdout_isatty):
34 output_filename = tmp_path / 'test_output_option'
35 url = httpbin + '/robots.txt'
36
37 r = http('--output', str(output_filename), url,
38 env=MockEnvironment(stdout_isatty=stdout_isatty))
39 assert r == ''
40
41 expected_body = urlopen(url).read().decode()
42 actual_body = output_filename.read_text(encoding=UTF8)
43
44 assert actual_body == expected_body
45
46
47class TestQuietFlag:

Callers

nothing calls this directly

Calls 3

httpFunction · 0.85
MockEnvironmentClass · 0.85
decodeMethod · 0.80

Tested by

no test coverage detected