Example #1
0
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')
Example #2
0
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
Example #3
0
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
Example #4
0
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')
Example #5
0
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
Example #6
0
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
Example #7
0
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
Example #8
0
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
Example #9
0
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')
Example #10
0
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
Example #11
0
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
Example #12
0
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')
Example #13
0
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
Example #14
0
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')
Example #15
0
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')