MCPcopy Index your code
hub / github.com/python/cpython / test_extant_path

Method test_extant_path

Lib/test/test_importlib/resources/util.py:127–136  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

125 self.assertEqual(package.__loader__._path, 'utf-8.file')
126
127 def test_extant_path(self):
128 # Attempting to open or read or request the path when the
129 # path does exist should still succeed. Does not assert
130 # anything about the result.
131 bytes_data = io.BytesIO(b'Hello, world!')
132 # any path that exists
133 path = __file__
134 package = create_package(file=bytes_data, path=path)
135 self.execute(package, 'utf-8.file')
136 self.assertEqual(package.__loader__._path, 'utf-8.file')
137
138 def test_useless_loader(self):
139 package = create_package(file=FileNotFoundError(), path=FileNotFoundError())

Callers

nothing calls this directly

Calls 3

executeMethod · 0.95
create_packageFunction · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected