MCPcopy
hub / github.com/pex-tool/pex / test_named_temporary_file

Function test_named_temporary_file

tests/test_util.py:162–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160
161
162def test_named_temporary_file():
163 # type: () -> None
164 with named_temporary_file() as fp:
165 name = fp.name
166 fp.write(b"hi")
167 fp.flush()
168 assert os.path.exists(name)
169 with open(name) as new_fp:
170 assert new_fp.read() == "hi"
171
172 assert not os.path.exists(name)

Callers

nothing calls this directly

Calls 3

named_temporary_fileFunction · 0.90
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected