You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-08-10 22:42:05 +02:00
Added tests for --quiet flag
This commit is contained in:
committed by
Jakub Roztocil
parent
a4a1e8d43b
commit
4bd2e622a5
@@ -189,3 +189,11 @@ class TestDownloads:
|
||||
assert os.listdir('.') == [expected_filename]
|
||||
finally:
|
||||
os.chdir(orig_cwd)
|
||||
|
||||
def test_download_quietflag(self, httpbin_both, httpbin):
|
||||
robots_txt = '/robots.txt'
|
||||
body = urlopen(httpbin + robots_txt).read().decode()
|
||||
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
|
||||
r = http('--quiet', '--download', httpbin_both.url + robots_txt, env=env)
|
||||
assert r.stderr == ''
|
||||
assert body == r
|
||||
|
@@ -32,6 +32,15 @@ def test_output_option(httpbin, stdout_isatty):
|
||||
assert actual_body == expected_body
|
||||
|
||||
|
||||
class TestQuietFlag:
|
||||
def test_quiet(self, httpbin):
|
||||
r = http('--quiet', 'GET', httpbin.url + '/get')
|
||||
# check stdin
|
||||
assert r.stderr == ''
|
||||
# Check stdout
|
||||
assert str(r) == ''
|
||||
|
||||
|
||||
class TestVerboseFlag:
|
||||
def test_verbose(self, httpbin):
|
||||
r = http('--verbose',
|
||||
|
Reference in New Issue
Block a user