test(utils): simplify atomic write tests and remove stale note
This commit is contained in:
1 parent
d3f90e0944
commit
3fe109bf01
3 files changed
+17
-84
No files matched your search
@@ -230,8 +230,6 @@ class TestHistoryWithCursor:
|
||||
store.append_history("event 1")
|
||||
entries = store.read_unprocessed_history(since_cursor=0)
|
||||
|
||||
tmp_path_obj = store.history_file.with_suffix(".jsonl.tmp")
|
||||
|
||||
# Mock os.replace to raise an exception
|
||||
def failing_replace(*args, **kwargs):
|
||||
raise RuntimeError("Simulated failure")
|
||||
@@ -242,7 +240,6 @@ class TestHistoryWithCursor:
|
||||
store._write_entries(entries)
|
||||
|
||||
# Temp file should be cleaned up, including uniquely named temps.
|
||||
assert not tmp_path_obj.exists()
|
||||
assert list(store.history_file.parent.glob("*.tmp")) == []
|
||||
|
||||
# Original file should still exist (because replace failed)
|
||||
|
||||
Reference in new issue
Block a user