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

32 lines
836 B
Python
Raw Normal View History

2014-04-24 15:07:31 +03:00
import os
import tempfile
from unittest import TestCase
2014-04-24 15:07:31 +03:00
2014-04-24 16:17:23 +03:00
import pytest
from tests import TestEnvironment, http, httpbin, Environment
from httpie.compat import is_windows
2014-04-24 15:07:31 +03:00
class WindowsOnlyTests(TestCase):
2014-04-24 15:07:31 +03:00
2014-04-24 16:17:23 +03:00
@pytest.mark.skipif(not is_windows, reason='windows-only')
2014-04-24 15:07:31 +03:00
def test_windows_colorized_output(self):
# Spits out the colorized output.
http(httpbin('/get'), env=Environment())
class FakeWindowsTest(TestCase):
2014-04-24 15:07:31 +03:00
def test_output_file_pretty_not_allowed_on_windows(self):
r = http(
'--output',
os.path.join(tempfile.gettempdir(), '__httpie_test_output__'),
'--pretty=all',
'GET',
httpbin('/get'),
env=TestEnvironment(is_windows=True)
)
assert 'Only terminal output can be colorized on Windows' in r.stderr