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

Function test_safe_open_abs

tests/test_common.py:319–326  ·  view source on GitHub ↗
(temporary_working_dir)

Source from the content-addressed store, hash-verified

317
318
319def test_safe_open_abs(temporary_working_dir):
320 # type: (str) -> None
321 abs_path = os.path.join(temporary_working_dir, "path")
322 with safe_open(abs_path, "w") as fp:
323 fp.write("contents")
324
325 with open(abs_path) as fp:
326 assert "contents" == fp.read()
327
328
329def test_safe_open_relative(temporary_working_dir):

Callers

nothing calls this directly

Calls 4

safe_openFunction · 0.90
joinMethod · 0.45
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected