PATH:
opt
/
bitninja-python-dojo
/
embedded
/
lib
/
python3.9
/
test
/
test_importlib
import typing import unittest from importlib import resources from importlib.abc import Traversable from . import data01 from . import util class FilesTests: def test_read_bytes(self): files = resources.files(self.data) actual = files.joinpath('utf-8.file').read_bytes() assert actual == b'Hello, UTF-8 world!\n' def test_read_text(self): files = resources.files(self.data) actual = files.joinpath('utf-8.file').read_text() assert actual == 'Hello, UTF-8 world!\n' @unittest.skipUnless( hasattr(typing, 'runtime_checkable'), "Only suitable when typing supports runtime_checkable", ) def test_traversable(self): assert isinstance(resources.files(self.data), Traversable) class OpenDiskTests(FilesTests, unittest.TestCase): def setUp(self): self.data = data01 class OpenZipTests(FilesTests, util.ZipSetup, unittest.TestCase): pass if __name__ == '__main__': unittest.main()
[+]
zipdata01
[-] threaded_import_hangers.py
[edit]
[-] test_metadata_api.py
[edit]
[-] test_util.py
[edit]
[+]
data
[-] fixtures.py
[edit]
[-] test_spec.py
[edit]
[+]
..
[-] test_path.py
[edit]
[-] test_namespace_pkgs.py
[edit]
[-] test_resource.py
[edit]
[+]
data01
[+]
partial
[+]
data02
[-] util.py
[edit]
[-] __main__.py
[edit]
[-] test_threaded_import.py
[edit]
[-] abc.py
[edit]
[-] test_locks.py
[edit]
[+]
builtin
[+]
__pycache__
[-] test_main.py
[edit]
[-] test_files.py
[edit]
[+]
import_
[-] test_zip.py
[edit]
[-] test_open.py
[edit]
[+]
namespace_pkgs
[+]
zipdata02
[+]
source
[-] test_windows.py
[edit]
[-] stubs.py
[edit]
[-] test_pkg_import.py
[edit]
[-] __init__.py
[edit]
[-] test_abc.py
[edit]
[+]
data03
[-] test_lazy.py
[edit]
[-] test_read.py
[edit]
[+]
frozen
[+]
extension
[-] test_api.py
[edit]