mirror of
https://github.com/httpie/cli.git
synced 2025-03-13 06:18:33 +01:00
parent
5e87d1b057
commit
da6cc13b8b
@ -103,7 +103,7 @@ dev =
|
||||
pytest-httpbin>=0.0.6
|
||||
responses
|
||||
pytest-mock
|
||||
werkzeug<2.1.0
|
||||
werkzeug<4
|
||||
flake8
|
||||
flake8-comprehensions
|
||||
flake8-deprecated
|
||||
@ -119,7 +119,7 @@ test =
|
||||
pytest-httpbin>=0.0.6
|
||||
responses
|
||||
pytest-mock
|
||||
werkzeug<2.1.0
|
||||
werkzeug<4
|
||||
|
||||
[options.data_files]
|
||||
share/man/man1 =
|
||||
|
@ -32,19 +32,22 @@ class TestBinaryRequestData:
|
||||
|
||||
|
||||
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):
|
||||
r = http('GET', httpbin + '/bytes/1024?seed=1')
|
||||
def test_binary_suppresses_when_terminal(self, remote_httpbin):
|
||||
r = http('GET', remote_httpbin + '/bytes/1024?seed=1')
|
||||
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)
|
||||
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
|
||||
|
||||
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)
|
||||
url = httpbin + '/bytes/1024?seed=1'
|
||||
url = remote_httpbin + '/bytes/1024?seed=1'
|
||||
r = http('GET', url, env=env)
|
||||
expected = niquests.get(url).content
|
||||
assert r == expected
|
||||
|
Loading…
Reference in New Issue
Block a user