httpie-cli/tests/test_windows.py

30 lines
950 B
Python
Raw Normal View History

2014-04-24 14:07:31 +02:00
import os
import tempfile
2014-04-24 15:17:23 +02:00
import pytest
from httpie.context import Environment
2014-04-24 15:17:23 +02:00
from tests import TestEnvironment, http, httpbin
2014-04-24 15:17:23 +02:00
from httpie.compat import is_windows
2014-04-24 14:07:31 +02:00
@pytest.mark.skipif(not is_windows, reason='windows-only')
class TestWindowsOnly:
2014-04-26 11:06:50 +02:00
@pytest.mark.skipif(True,
reason='this test for some reason kills the process')
2014-04-24 14:07:31 +02:00
def test_windows_colorized_output(self):
# Spits out the colorized output.
http(httpbin('/get'), env=Environment())
class TestFakeWindows:
2014-04-24 14:07:31 +02:00
def test_output_file_pretty_not_allowed_on_windows(self):
2014-04-24 15:48:01 +02:00
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'),
env=env, error_exit_ok=True)
assert 'Only terminal output can be colorized on Windows' in r.stderr