diff --git a/httpie/input.py b/httpie/input.py index 0fb67357..f1ebcde7 100644 --- a/httpie/input.py +++ b/httpie/input.py @@ -16,7 +16,7 @@ from .compat import OrderedDict # https://github.com/jkbr/httpie/issues/130 from requests.structures import CaseInsensitiveDict -from .compat import urlsplit, str, bytes +from .compat import urlsplit, str from .sessions import VALID_SESSION_NAME_PATTERN diff --git a/tests/test_sessions.py b/tests/test_sessions.py index 2ef4bafd..7a71ed13 100644 --- a/tests/test_sessions.py +++ b/tests/test_sessions.py @@ -1,8 +1,8 @@ # coding=utf-8 import os import shutil -from httpie.plugins.builtin import HTTPBasicAuth +from httpie.plugins.builtin import HTTPBasicAuth from tests import TestEnvironment, mk_config_dir, http, httpbin, HTTP_OK diff --git a/tests/test_unicode.py b/tests/test_unicode.py index 4d09bd52..278e8316 100644 --- a/tests/test_unicode.py +++ b/tests/test_unicode.py @@ -19,27 +19,28 @@ class TestUnicode: def test_unicode_form_item(self): r = http('--form', 'POST', httpbin('/post'), u'test=%s' % UNICODE) assert HTTP_OK in r - assert r.json['form']['test'] == UNICODE + assert r.json['form'] == {'test': UNICODE} def test_unicode_json_item(self): r = http('--json', 'POST', httpbin('/post'), u'test=%s' % UNICODE) assert HTTP_OK in r - assert r.json['json']['test'] == UNICODE + assert r.json['json'] == {'test': UNICODE} def test_unicode_raw_json_item(self): - r = http('--json', 'POST', httpbin('/post'), u'test:=["%s"]' % UNICODE) + r = http('--json', 'POST', httpbin('/post'), + u'test:={ "%s" : [ "%s" ] }' % (UNICODE, UNICODE)) assert HTTP_OK in r - assert r.json['json']['test'] == [UNICODE] + assert r.json['json'] == {'test': {UNICODE: [UNICODE]}} def test_unicode_url_query_arg_item(self): r = http(httpbin('/get'), u'test==%s' % UNICODE) assert HTTP_OK in r - assert r.json['args']['test'] == UNICODE, r + assert r.json['args'] == {'test': UNICODE}, r def test_unicode_url(self): r = http(httpbin(u'/get?test=' + UNICODE)) assert HTTP_OK in r - assert r.json['args']['test'] == UNICODE + assert r.json['args'] == {'test': UNICODE} def test_unicode_basic_auth(self): # it doesn't really authenticate us because httpbin