mirror of
https://github.com/httpie/cli.git
synced 2024-11-25 17:23:25 +01:00
28 lines
650 B
Python
28 lines
650 B
Python
"""Miscellaneous regression tests"""
|
|
import pytest
|
|
|
|
from utils import http, HTTP_OK
|
|
from httpie.compat import is_windows
|
|
|
|
|
|
def test_Host_header_overwrite(httpbin):
|
|
"""
|
|
https://github.com/jkbrzt/httpie/issues/235
|
|
|
|
"""
|
|
host = 'httpbin.org'
|
|
url = httpbin.url + '/get'
|
|
r = http('--print=hH', url, 'host:{0}'.format(host))
|
|
assert HTTP_OK in r
|
|
assert r.lower().count('host:') == 1
|
|
assert 'host: {0}'.format(host) in r
|
|
|
|
|
|
@pytest.mark.skipif(is_windows, reason='Unix-only')
|
|
def test_output_devnull(httpbin):
|
|
"""
|
|
https://github.com/jkbrzt/httpie/issues/252
|
|
|
|
"""
|
|
http('--output=/dev/null', httpbin + '/get')
|