httpie-cli/tests/test_regressions.py

28 lines
664 B
Python
Raw Normal View History

2014-06-28 13:24:14 +02:00
"""Miscellaneous regression tests"""
import pytest
2014-06-28 13:24:14 +02:00
from utils import http, HTTP_OK
from httpie.compat import is_windows
2014-06-28 13:24:14 +02:00
def test_Host_header_overwrite(httpbin):
2014-06-28 13:24:14 +02:00
"""
https://github.com/jakubroztocil/httpie/issues/235
"""
host = 'httpbin.org'
url = httpbin.url + '/get'
r = http('--print=hH', url, 'host:{0}'.format(host))
2014-06-28 13:24:14 +02:00
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/jakubroztocil/httpie/issues/252
"""
http('--output=/dev/null', httpbin + '/get')