MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / test_atomic_write_text_preserves_existing_mode

Function test_atomic_write_text_preserves_existing_mode

tests/test_locks.py:89–97  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

87
88
89def test_atomic_write_text_preserves_existing_mode(tmp_path):
90 target = tmp_path / "file.txt"
91 target.write_text("first", encoding="utf-8")
92 target.chmod(0o640)
93
94 atomic_write_text(target, "second")
95
96 assert target.read_text(encoding="utf-8") == "second"
97 assert stat.S_IMODE(target.stat().st_mode) == 0o640
98
99
100def test_atomic_write_json_replaces_file(tmp_path):

Callers

nothing calls this directly

Calls 1

atomic_write_textFunction · 0.90

Tested by

no test coverage detected