1
0
mirror of https://github.com/httpie/cli.git synced 2025-07-15 01:34:27 +02:00

Fixed colorized output on Windows with Python 3.

Closes #87.
This commit is contained in:
Jakub Roztocil
2012-08-17 06:35:18 +02:00
parent 86256af1df
commit 4660da949f
5 changed files with 56 additions and 20 deletions

View File

@ -33,9 +33,9 @@ try:
except ImportError:
from urllib2 import urlopen
try:
from unittest import skipIf
from unittest import skipIf, skip
except ImportError:
skip = lambda msg: lambda self: None
def skipIf(cond, reason):
def decorator(test_method):
if cond:
@ -47,7 +47,6 @@ from requests import __version__ as requests_version
from requests.compat import is_windows, is_py26, bytes, str
#################################################################
# Utils/setup
#################################################################
@ -863,6 +862,7 @@ class ExitStatusTest(BaseTestCase):
self.assertEqual(r.exit_status, EXIT.OK)
self.assertTrue(not r.stderr)
@skip('httpbin.org always returns 500')
def test_timeout_exit_status(self):
r = http(
'--timeout=0.5',
@ -917,6 +917,15 @@ class ExitStatusTest(BaseTestCase):
self.assertEqual(r.exit_status, EXIT.ERROR_HTTP_5XX)
class WindowsOnlyTests(BaseTestCase):
@skip('FIXME: kills the runner')
#@skipIf(not is_windows, 'windows-only')
def test_windows_colorized_output(self):
# Spits out the colorized output.
http(httpbin('/get'), env=Environment())
class FakeWindowsTest(BaseTestCase):
def test_stdout_redirect_not_supported_on_windows(self):