mirror of
https://github.com/httpie/cli.git
synced 2025-03-13 14:28:50 +01:00
parent
5e87d1b057
commit
da6cc13b8b
@ -103,7 +103,7 @@ dev =
|
|||||||
pytest-httpbin>=0.0.6
|
pytest-httpbin>=0.0.6
|
||||||
responses
|
responses
|
||||||
pytest-mock
|
pytest-mock
|
||||||
werkzeug<2.1.0
|
werkzeug<4
|
||||||
flake8
|
flake8
|
||||||
flake8-comprehensions
|
flake8-comprehensions
|
||||||
flake8-deprecated
|
flake8-deprecated
|
||||||
@ -119,7 +119,7 @@ test =
|
|||||||
pytest-httpbin>=0.0.6
|
pytest-httpbin>=0.0.6
|
||||||
responses
|
responses
|
||||||
pytest-mock
|
pytest-mock
|
||||||
werkzeug<2.1.0
|
werkzeug<4
|
||||||
|
|
||||||
[options.data_files]
|
[options.data_files]
|
||||||
share/man/man1 =
|
share/man/man1 =
|
||||||
|
@ -32,19 +32,22 @@ class TestBinaryRequestData:
|
|||||||
|
|
||||||
|
|
||||||
class TestBinaryResponseData:
|
class TestBinaryResponseData:
|
||||||
|
"""local httpbin crash due to an unfixed bug.
|
||||||
|
See https://github.com/psf/httpbin/pull/41
|
||||||
|
It is merged but not yet released."""
|
||||||
|
|
||||||
def test_binary_suppresses_when_terminal(self, httpbin):
|
def test_binary_suppresses_when_terminal(self, remote_httpbin):
|
||||||
r = http('GET', httpbin + '/bytes/1024?seed=1')
|
r = http('GET', remote_httpbin + '/bytes/1024?seed=1')
|
||||||
assert BINARY_SUPPRESSED_NOTICE.decode() in r
|
assert BINARY_SUPPRESSED_NOTICE.decode() in r
|
||||||
|
|
||||||
def test_binary_suppresses_when_not_terminal_but_pretty(self, httpbin):
|
def test_binary_suppresses_when_not_terminal_but_pretty(self, remote_httpbin):
|
||||||
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
|
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
|
||||||
r = http('--pretty=all', 'GET', httpbin + '/bytes/1024?seed=1', env=env)
|
r = http('--pretty=all', 'GET', remote_httpbin + '/bytes/1024?seed=1', env=env)
|
||||||
assert BINARY_SUPPRESSED_NOTICE.decode() in r
|
assert BINARY_SUPPRESSED_NOTICE.decode() in r
|
||||||
|
|
||||||
def test_binary_included_and_correct_when_suitable(self, httpbin):
|
def test_binary_included_and_correct_when_suitable(self, remote_httpbin):
|
||||||
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
|
env = MockEnvironment(stdin_isatty=True, stdout_isatty=False)
|
||||||
url = httpbin + '/bytes/1024?seed=1'
|
url = remote_httpbin + '/bytes/1024?seed=1'
|
||||||
r = http('GET', url, env=env)
|
r = http('GET', url, env=env)
|
||||||
expected = niquests.get(url).content
|
expected = niquests.get(url).content
|
||||||
assert r == expected
|
assert r == expected
|
||||||
|
Loading…
Reference in New Issue
Block a user