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

Method test_missing_path

Lib/test/test_importlib/resources/util.py:116–125  ·  view source on GitHub ↗

Attempting to open or read or request the path for a non-existent path should succeed if open_resource can return a viable data stream.

(self)

Source from the content-addressed store, hash-verified

114 self.execute(self.data.__name__, 'utf-8.file')
115
116 def test_missing_path(self):
117 """
118 Attempting to open or read or request the path for a
119 non-existent path should succeed if open_resource
120 can return a viable data stream.
121 """
122 bytes_data = io.BytesIO(b'Hello, world!')
123 package = create_package(file=bytes_data, path=FileNotFoundError())
124 self.execute(package, 'utf-8.file')
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

Callers

nothing calls this directly

Calls 3

executeMethod · 0.95
create_packageFunction · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected