1
0
mirror of https://github.com/httpie/cli.git synced 2025-12-07 23:32:40 +02:00

Added additional tests for flag and better documentation

This commit is contained in:
Nicolas Beltran
2020-07-14 16:33:07 -05:00
committed by Jakub Roztocil
parent d546081340
commit 7e38f9ccf0
3 changed files with 50 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ from urllib.request import urlopen
import pytest
import mock
import requests
from requests.structures import CaseInsensitiveDict
from httpie.downloads import (
@@ -190,10 +191,12 @@ class TestDownloads:
finally:
os.chdir(orig_cwd)
def test_download_quietflag(self, httpbin_both, httpbin):
def test_download_with_quiet_flag(self, httpbin_both, httpbin):
robots_txt = '/robots.txt'
body = urlopen(httpbin + robots_txt).read().decode()
body = requests.get(httpbin + robots_txt).text
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
assert env.devnull == env.stderr
assert env.devnull == env.stdout