You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-12-30 00:39:32 +02:00
Improve support for 'type/subtype+suffix' mime types in the colors output formatter.
E.g.: * application/ld+json * application/hal+json Closes #189, #206
This commit is contained in:
@@ -11,7 +11,6 @@ def has_docutils():
|
||||
try:
|
||||
#noinspection PyUnresolvedReferences
|
||||
import docutils
|
||||
|
||||
return True
|
||||
except ImportError:
|
||||
return False
|
||||
|
||||
@@ -29,15 +29,17 @@ class TestVerboseFlag:
|
||||
class TestColors:
|
||||
|
||||
@pytest.mark.parametrize('mime', [
|
||||
'text/html',
|
||||
'foo/html',
|
||||
'text/html+foo',
|
||||
'text/foo+html'
|
||||
'application/json',
|
||||
'application/json+foo',
|
||||
'application/foo+json',
|
||||
'foo/json',
|
||||
'foo/json+bar',
|
||||
'foo/bar+json',
|
||||
])
|
||||
def test_get_lexer(self, mime):
|
||||
lexer = get_lexer(mime)
|
||||
assert lexer is not None
|
||||
assert lexer.name == 'HTML'
|
||||
assert lexer.name == 'JSON'
|
||||
|
||||
def test_get_lexer_not_found(self):
|
||||
assert get_lexer('xxx/yyy') is None
|
||||
|
||||
Reference in New Issue
Block a user