Added test_unicode_url_query_arg_item.

This commit is contained in:
Jakub Roztocil 2014-04-26 18:23:13 +02:00
parent a3352af1d4
commit 84a521a827

View File

@ -3,7 +3,7 @@
Various unicode handling related tests.
"""
from tests import http, httpbin
from tests import http, httpbin, HTTP_OK
UNICODE = u'太陽'
@ -13,22 +13,32 @@ class TestUnicode:
def test_unicode_headers(self):
r = http('GET', httpbin('/headers'), u'Test:%s' % UNICODE)
assert HTTP_OK in r
assert r.json['headers']['Test'] == UNICODE
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
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
def test_unicode_raw_json_item(self):
r = http('--json', 'POST', httpbin('/post'), u'test:=["%s"]' % UNICODE)
assert HTTP_OK in r
assert r.json['json']['test'] == [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
def test_unicode_url(self):
r = http(httpbin(u'/get?test=' + UNICODE))
assert HTTP_OK in r
assert r.json['args']['test'] == UNICODE
def test_unicode_basic_auth(self):