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