More unicode.

This commit is contained in:
Jakub Roztocil 2014-04-26 19:47:14 +02:00
parent 0bd218eab0
commit eca1ffaedb
6 changed files with 7 additions and 6 deletions

View File

@ -1,3 +1,4 @@
# coding=utf-8
"""Utilities used by HTTPie tests. """Utilities used by HTTPie tests.
""" """

View File

@ -32,3 +32,5 @@ with codecs.open(JSON_FILE_PATH, encoding='utf8') as f:
with open(BIN_FILE_PATH, 'rb') as f: with open(BIN_FILE_PATH, 'rb') as f:
BIN_FILE_CONTENT = f.read() BIN_FILE_CONTENT = f.read()
UNICODE = FILE_CONTENT

View File

@ -1,4 +1,4 @@
{ {
"name": "Jakub Roztočil", "name": "Jakub Roztočil",
"sun": "太陽" "unicode": "χρυσαφὶ 太陽 เลิศ ♜♞♝♛♚♝♞♜ оживлённым तान्यहानि 有朋"
} }

View File

@ -1 +1 @@
some UTF8-encoded unicode text 太陽 by Jakub Roztočil [one line of UTF8-encoded unicode text] χρυσαφὶ 太陽 เลิศ ♜♞♝♛♚♝♞♜ оживлённым तान्यहानि 有朋 ஸ்றீனிவாஸ ٱلرَّحْمـَبنِ

View File

@ -4,6 +4,7 @@ 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 from tests import TestEnvironment, mk_config_dir, http, httpbin, HTTP_OK
from tests.fixtures import UNICODE
class SessionTestBase(object): class SessionTestBase(object):
@ -125,7 +126,6 @@ class TestSession(SessionTestBase):
assert r2.json['headers']['Foo'] == 'Bar' assert r2.json['headers']['Foo'] == 'Bar'
def test_session_unicode(self): def test_session_unicode(self):
UNICODE = u'太陽'
r1 = http('--session=test', '--auth', u'test:' + UNICODE, r1 = http('--session=test', '--auth', u'test:' + UNICODE,
'GET', httpbin('/get'), 'GET', httpbin('/get'),
u'Test:%s' % UNICODE, u'Test:%s' % UNICODE,

View File

@ -4,9 +4,7 @@ Various unicode handling related tests.
""" """
from tests import http, httpbin, HTTP_OK from tests import http, httpbin, HTTP_OK
from tests.fixtures import UNICODE
UNICODE = u'太陽'
class TestUnicode: class TestUnicode: