1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00
httpie-cli/tests/test_windows.py

26 lines
948 B
Python
Raw Normal View History

2014-04-24 16:17:23 +03:00
import pytest
from httpie.context import Environment
2014-04-24 16:17:23 +03:00
from .utils import MockEnvironment, http
2014-04-24 16:17:23 +03:00
from httpie.compat import is_windows
2014-04-24 15:07:31 +03:00
@pytest.mark.skipif(not is_windows, reason='windows-only')
class TestWindowsOnly:
2014-04-26 12:06:50 +03:00
@pytest.mark.skipif(True,
reason='this test for some reason kills the process')
def test_windows_colorized_output(self, httpbin):
2014-04-24 15:07:31 +03:00
# Spits out the colorized output.
2024-03-04 19:12:18 +02:00
http(httpbin + '/get', env=Environment())
2014-04-24 15:07:31 +03:00
class TestFakeWindows:
def test_output_file_pretty_not_allowed_on_windows(self, tmp_path, httpbin):
env = MockEnvironment(is_windows=True)
output_file = tmp_path / 'test_output_file_pretty_not_allowed_on_windows'
r = http('--output', str(output_file),
2024-03-04 19:12:18 +02:00
'--pretty=all', 'GET', httpbin + '/get',
env=env, tolerate_error_exit_status=True)
assert 'Only terminal output can be colorized on Windows' in r.stderr