mirror of https://github.com/pypa/pip
Adds test for native_str()
This commit is contained in:
parent
a8a5ad41a2
commit
48584f0de7
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
from pip.compat import get_path_uid
|
||||
from pip.compat import get_path_uid, native_str
|
||||
import pytest
|
||||
|
||||
|
||||
|
@ -35,3 +35,10 @@ def test_get_path_uid_symlink_without_NOFOLLOW(tmpdir, monkeypatch):
|
|||
os.symlink(f, fs)
|
||||
with pytest.raises(OSError):
|
||||
get_path_uid(fs)
|
||||
|
||||
|
||||
def test_to_native_str_type():
|
||||
some_bytes = b"test\xE9 et approuv\xC3\xE9"
|
||||
some_unicode = b"test\xE9 et approuv\xE9".decode('iso-8859-15')
|
||||
assert isinstance(native_str(some_bytes, True), str)
|
||||
assert isinstance(native_str(some_unicode, True), str)
|
||||
|
|
Loading…
Reference in New Issue