예제 #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')
예제 #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
예제 #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
예제 #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')
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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')
예제 #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
예제 #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
예제 #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')
예제 #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
예제 #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')
예제 #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')