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