forked from extern/httpie-cli
Cleanup
This commit is contained in:
parent
14763e619d
commit
76ab8b84be
@ -1,3 +1,4 @@
|
|||||||
|
# https://travis-ci.org/jkbr/httpie
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- 2.6
|
- 2.6
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
from httpie import ExitStatus
|
from httpie import ExitStatus
|
||||||
|
from httpie.output.processors.colors import get_lexer
|
||||||
from tests import TestEnvironment, http, httpbin, HTTP_OK, COLOR, CRLF
|
from tests import TestEnvironment, http, httpbin, HTTP_OK, COLOR, CRLF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestVerboseFlag:
|
class TestVerboseFlag:
|
||||||
def test_verbose(self):
|
def test_verbose(self):
|
||||||
r = http('--verbose', 'GET', httpbin('/get'), 'test-header:__test__')
|
r = http('--verbose', 'GET', httpbin('/get'), 'test-header:__test__')
|
||||||
@ -22,6 +26,23 @@ class TestVerboseFlag:
|
|||||||
assert r'\"baz\": \"bar\"' in r # response
|
assert r'\"baz\": \"bar\"' in r # response
|
||||||
|
|
||||||
|
|
||||||
|
class TestColors:
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('mime', [
|
||||||
|
'text/html',
|
||||||
|
'foo/html',
|
||||||
|
'text/html+foo',
|
||||||
|
'text/foo+html'
|
||||||
|
])
|
||||||
|
def test_get_lexer(self, mime):
|
||||||
|
lexer = get_lexer(mime)
|
||||||
|
assert lexer is not None
|
||||||
|
assert lexer.name == 'HTML'
|
||||||
|
|
||||||
|
def test_get_lexer_not_found(self):
|
||||||
|
assert get_lexer('xxx/yyy') is None
|
||||||
|
|
||||||
|
|
||||||
class TestPrettyOptions:
|
class TestPrettyOptions:
|
||||||
"""Test the --pretty flag handling."""
|
"""Test the --pretty flag handling."""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user