mirror of
https://github.com/httpie/cli.git
synced 2024-11-08 00:44:45 +01:00
Fixed tests.
This commit is contained in:
parent
b44bc0928f
commit
8e170b059c
@ -61,7 +61,8 @@ def decode_args(args, stdin_encoding):
|
||||
|
||||
"""
|
||||
return [
|
||||
arg.decode(stdin_encoding) if type(arg) == bytes else arg
|
||||
arg.decode(stdin_encoding)
|
||||
if type(arg) == bytes else arg
|
||||
for arg in args
|
||||
]
|
||||
|
||||
@ -72,10 +73,11 @@ def main(args=sys.argv[1:], env=Environment()):
|
||||
Return exit status code.
|
||||
|
||||
"""
|
||||
from httpie.cli import parser
|
||||
|
||||
args = decode_args(args, env.stdin_encoding)
|
||||
plugin_manager.load_installed_plugins()
|
||||
|
||||
from httpie.cli import parser
|
||||
|
||||
if env.config.default_options:
|
||||
args = env.config.default_options + args
|
||||
|
||||
|
@ -132,11 +132,13 @@ class TestSession(SessionTestBase):
|
||||
env=self.env())
|
||||
assert HTTP_OK in r1
|
||||
|
||||
r2 = http('--session=test', 'GET', httpbin('/get'), env=self.env())
|
||||
r2 = http('--session=test', '--verbose', 'GET',
|
||||
httpbin('/get'), env=self.env())
|
||||
assert HTTP_OK in r2
|
||||
assert (r2.json['headers']['Authorization']
|
||||
== HTTPBasicAuth.make_header(u'test', UNICODE))
|
||||
assert r2.json['headers']['Test'] == UNICODE
|
||||
# httpbin doesn't interpret utf8 headers
|
||||
assert UNICODE in r2
|
||||
|
||||
def test_session_default_header_value_overwritten(self):
|
||||
# https://github.com/jakubroztocil/httpie/issues/180
|
||||
|
@ -10,11 +10,12 @@ from fixtures import UNICODE
|
||||
class TestUnicode:
|
||||
|
||||
def test_unicode_headers(self):
|
||||
# httpbin doesn't interpret utf8 headers
|
||||
r = http(httpbin('/headers'), u'Test:%s' % UNICODE)
|
||||
assert HTTP_OK in r
|
||||
assert r.json['headers']['Test'] == UNICODE
|
||||
|
||||
def test_unicode_headers_verbose(self):
|
||||
# httpbin doesn't interpret utf8 headers
|
||||
r = http('--verbose', httpbin('/headers'), u'Test:%s' % UNICODE)
|
||||
assert HTTP_OK in r
|
||||
assert UNICODE in r
|
||||
|
Loading…
Reference in New Issue
Block a user