mirror of
https://github.com/httpie/cli.git
synced 2025-01-09 07:08:54 +01:00
Add tests for --offline
This commit is contained in:
parent
4f32b76223
commit
8936d1b71e
@ -181,3 +181,23 @@ def test_json_input_preserve_order(httpbin_both):
|
||||
assert HTTP_OK in r
|
||||
assert r.json['data'] == \
|
||||
'{"order": {"map": {"1": "first", "2": "second"}}}'
|
||||
|
||||
|
||||
def test_offline():
|
||||
r = http(
|
||||
'--offline',
|
||||
'https://this-should.never-resolve/foo',
|
||||
'param==value'
|
||||
)
|
||||
assert 'GET /foo?param=value' in r
|
||||
|
||||
|
||||
def test_offline_download():
|
||||
"""Absence of response should be handled gracefully with --download"""
|
||||
r = http(
|
||||
'--offline',
|
||||
'--download',
|
||||
'https://this-should.never-resolve/foo',
|
||||
'param==value'
|
||||
)
|
||||
assert 'GET /foo?param=value' in r
|
||||
|
Loading…
Reference in New Issue
Block a user