コード例 #1
0
def test_to_native_win1252able():
    expected = UNICODE.utf8.encode('cp1252',
                                   'ignore') if PY2 else repr(win1252able)
    assert to_native(win1252able) == expected
コード例 #2
0
def test_to_native_with_byte_string(value):  # pragma: no cover
    if PY2:
        assert to_native(value) == value
    else:
        assert to_native(value) == from_bytes(value)
コード例 #3
0
def test_to_native_utf8able():
    expected = UNICODE.utf8.encode('UTF-8') if PY2 else repr(utf8able)
    assert to_native(utf8able) == expected
コード例 #4
0
def test_to_native_with_unicode_objects(value):  # pragma: no cover
    if PY2:
        assert to_native(value) == value.encode('UTF-8')
    else:
        assert to_native(value) == value
コード例 #5
0
ファイル: yelp_bytes_test.py プロジェクト: Yelp/yelp_bytes
def test_to_native_win1252able():
    expected = UNICODE.utf8.encode('cp1252', 'ignore') if PY2 else repr(win1252able)
    assert to_native(win1252able) == expected
コード例 #6
0
ファイル: yelp_bytes_test.py プロジェクト: Yelp/yelp_bytes
def test_to_native_utf8able():
    expected = UNICODE.utf8.encode('UTF-8') if PY2 else repr(utf8able)
    assert to_native(utf8able) == expected
コード例 #7
0
ファイル: yelp_bytes_test.py プロジェクト: Yelp/yelp_bytes
def test_to_native_with_byte_string(value):  # pragma: no cover
    if PY2:
        assert to_native(value) == value
    else:
        assert to_native(value) == from_bytes(value)
コード例 #8
0
ファイル: yelp_bytes_test.py プロジェクト: Yelp/yelp_bytes
def test_to_native_with_unicode_objects(value):  # pragma: no cover
    if PY2:
        assert to_native(value) == value.encode('UTF-8')
    else:
        assert to_native(value) == value