mirror of
https://github.com/httpie/cli.git
synced 2024-11-14 20:04:55 +01:00
01ca7f0eb2
This makes it easier to use HTTPie in cron jobs and scripts. Closes #259
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
import os
|
|
import tempfile
|
|
|
|
import pytest
|
|
from httpie.context import Environment
|
|
|
|
from utils import TestEnvironment, http
|
|
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, httpbin):
|
|
# Spits out the colorized output.
|
|
http(httpbin.url + '/get', env=Environment())
|
|
|
|
|
|
class TestFakeWindows:
|
|
def test_output_file_pretty_not_allowed_on_windows(self, httpbin):
|
|
env = TestEnvironment(is_windows=True)
|
|
output_file = os.path.join(
|
|
tempfile.gettempdir(),
|
|
self.test_output_file_pretty_not_allowed_on_windows.__name__
|
|
)
|
|
r = http('--output', output_file,
|
|
'--pretty=all', 'GET', httpbin.url + '/get',
|
|
env=env, error_exit_ok=True)
|
|
assert 'Only terminal output can be colorized on Windows' in r.stderr
|