def test_python_2_string_with_utf8_str(): assert isinstance(utf8_str, str) result = string(utf8_str) assert isinstance(result, unicode) # noqa assert result == utf8_str.decode('utf-8')
def test_python_3_string_with_utf8_str(): assert isinstance(utf8_str, str) result = string(utf8_str) assert isinstance(result, str) assert result == utf8_str
def test_python_2_string_with_ascii_str(): assert isinstance(ascii_str, str) result = string(ascii_str) assert isinstance(result, unicode) # noqa assert result == ascii_str
def test_python_3_string_with_ascii_str(): assert isinstance(ascii_str, str) result = string(ascii_str) assert isinstance(result, str) assert result == ascii_str
def test_python_3_string_with_ascii_bytes(): ascii_bytes = ascii_str.encode('utf-8') assert isinstance(ascii_bytes, bytes) result = string(ascii_bytes) assert isinstance(result, str) assert result == ascii_bytes.decode('utf-8')
def test_python_2_string_with_ascii_unicode(): ascii_unicode = ascii_str.decode('utf-8') assert isinstance(ascii_unicode, unicode) # noqa result = string(ascii_unicode) assert isinstance(result, unicode) # noqa assert result == ascii_unicode
def test_python_2_string_with_utf8_unicode(): utf8_unicode = utf8_str.decode('utf-8') assert isinstance(utf8_unicode, unicode) result = string(utf8_unicode) assert isinstance(result, unicode) assert result == utf8_unicode
def test_python_3_string_with_utf8_bytes(): utf8_bytes = utf8_str.encode('utf-8') assert isinstance(utf8_bytes, bytes) result = string(utf8_bytes) assert isinstance(result, str) assert result == utf8_bytes.decode('utf-8')