httpie-cli/tests/test_windows.py

32 lines
836 B
Python
Raw Normal View History

2014-04-24 14:07:31 +02:00
import os
import tempfile
from unittest import TestCase
2014-04-24 14:07:31 +02:00
2014-04-24 15:17:23 +02:00
import pytest
from tests import TestEnvironment, http, httpbin, Environment
from httpie.compat import is_windows
2014-04-24 14:07:31 +02:00
class WindowsOnlyTests(TestCase):
2014-04-24 14:07:31 +02:00
2014-04-24 15:17:23 +02:00
@pytest.mark.skipif(not is_windows, reason='windows-only')
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 FakeWindowsTest(TestCase):
2014-04-24 14:07:31 +02: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