mirror of
https://github.com/httpie/cli.git
synced 2024-12-29 09:49:10 +01:00
15e62ad26d
* Immediatelly convert all args from `bytes` to `str`. * Added `Environment.stdin_encoding` and `Environment.stdout_encoding` * Allow unicode characters in HTTP headers and basic auth credentials by encoding them using UTF8 instead of latin1 (#212).
29 lines
924 B
Python
29 lines
924 B
Python
import os
|
|
import tempfile
|
|
|
|
import pytest
|
|
|
|
from tests import TestEnvironment, http, httpbin, Environment
|
|
from httpie.compat import is_windows
|
|
|
|
|
|
@pytest.mark.skipif(not is_windows, reason='windows-only')
|
|
class TestWindowsOnly:
|
|
|
|
@pytest.mark.skipif(True,
|
|
reason='this test for some reason kills the process')
|
|
def test_windows_colorized_output(self):
|
|
# Spits out the colorized output.
|
|
http(httpbin('/get'), env=Environment())
|
|
|
|
|
|
class TestFakeWindows:
|
|
def test_output_file_pretty_not_allowed_on_windows(self):
|
|
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
|