This commit is contained in:
Jakub Roztocil 2014-04-26 19:32:08 +02:00
parent 609950f327
commit 0bd218eab0
3 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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