(tmp_path, httpbin, stdout_isatty)
| 31 | |
| 32 | @pytest.mark.parametrize('stdout_isatty', [True, False]) |
| 33 | def 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 | |
| 47 | class TestQuietFlag: |
nothing calls this directly
no test coverage detected