예제 #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
def test_to_native_win1252able():
    expected = UNICODE.utf8.encode('cp1252', 'ignore') if PY2 else repr(win1252able)
    assert to_native(win1252able) == expected
예제 #6
0
def test_to_native_utf8able():
    expected = UNICODE.utf8.encode('UTF-8') if PY2 else repr(utf8able)
    assert to_native(utf8able) == expected
예제 #7
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)
예제 #8
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