1
0
mirror of https://github.com/httpie/cli.git synced 2025-02-03 13:01:58 +02:00

Fixed --timeout

* Require requests >= 2.3.0
* Updated test_timeout_exit_status

Close #185.
This commit is contained in:
Jakub Roztocil 2014-05-17 22:24:44 +02:00
parent 4449da456a
commit 77955c9837
2 changed files with 5 additions and 5 deletions

View File

@ -29,7 +29,7 @@ tests_require = [
install_requires = [ install_requires = [
'requests>=2.0.0', 'requests>=2.3.0',
'Pygments>=1.5' 'Pygments>=1.5'
] ]
try: try:

View File

@ -18,13 +18,13 @@ class TestExitStatus:
assert not r.stderr assert not r.stderr
@pytest.mark.skipif( @pytest.mark.skipif(
True, tuple(map(int, requests.__version__.split('.'))) < (2, 3, 0),
reason='timeout broken in requests' reason='timeout broken in requests prior v2.3.0 (#185)'
' (https://github.com/jakubroztocil/httpie/issues/185)') )
def test_timeout_exit_status(self): def test_timeout_exit_status(self):
r = http('--timeout=0.5', 'GET', httpbin('/delay/1'), r = http('--timeout=0.5', 'GET', httpbin('/delay/1'),
error_exit_ok=True) error_exit_ok=True)
assert HTTP_OK in r
assert r.exit_status == ExitStatus.ERROR_TIMEOUT assert r.exit_status == ExitStatus.ERROR_TIMEOUT
def test_3xx_check_status_exits_3_and_stderr_when_stdout_redirected(self): def test_3xx_check_status_exits_3_and_stderr_when_stdout_redirected(self):