mirror of
https://github.com/httpie/cli.git
synced 2025-01-23 13:58:45 +01:00
Cleanup
This commit is contained in:
parent
609950f327
commit
0bd218eab0
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user