Run tests against local httpbin instance via pytest-httpbin.

This commit is contained in:
Jakub Roztocil committed 2014-06-28 16:38:41 +02:00
1 parent 79329ed1c6
commit 2a72ae23d5
19 files changed
+300 -263

No files matched your search

+5 -5
View File
@@ -4,7 +4,7 @@ import tempfile
import pytest
from httpie.context import Environment
from utils import TestEnvironment, http, httpbin
from utils import TestEnvironment, http
from httpie.compat import is_windows
@@ -13,17 +13,17 @@ class TestWindowsOnly:
@pytest.mark.skipif(True,
reason='this test for some reason kills the process')
def test_windows_colorized_output(self):
def test_windows_colorized_output(self, httpbin):
# Spits out the colorized output.
http(httpbin('/get'), env=Environment())
http(httpbin.url + '/get', env=Environment())
class TestFakeWindows:
def test_output_file_pretty_not_allowed_on_windows(self):
def test_output_file_pretty_not_allowed_on_windows(self, httpbin):
env = TestEnvironment(is_windows=True)
output_file = os.path.join(
tempfile.gettempdir(), '__httpie_test_output__')
r = http('--output', output_file,
'--pretty=all', 'GET', httpbin('/get'),
'--pretty=all', 'GET', httpbin.url + '/get',
env=env, error_exit_ok=True)
assert 'Only terminal output can be colorized on Windows' in r.stderr