Gzip loop-claude's archive and the review folders 30 days after each file last changed, and read gzipped files by their plain name #572

Merged
lilleman merged 12 commits from item-306 into main 2026-11-17 02:58:40 +01:00
Showing only changes of commit 74d69fedfb - Show all commits
@@ -82,12 +82,16 @@ class Main(unittest.TestCase):
with mock.patch.object(main.time, "time", return_value=NOW):
self.assertEqual(self.run_main(now=None), (0, "Compressed 4 files.\n", ""))
def test_skips_a_file_removed_while_it_walks(self):
def test_walks_on_past_a_gzip_a_link_and_a_file_removed_while_it_walks(self):
gone = mock.Mock(**{"is_symlink.return_value": False, "stat.side_effect": FileNotFoundError})
# Mock(name=...) names the mock itself, so the path's name is set after.
gone.name = "gone.jsonl"
packed = self.archive / "c.jsonl.gz"
packed.write_bytes(b"")
link = self.archive / "d.jsonl"
link.symlink_to(self.archive / "a.jsonl")
kept = self.archive / "a.jsonl"
root = mock.Mock(**{"rglob.return_value": [gone, kept]})
root = mock.Mock(**{"rglob.return_value": [packed, link, gone, kept]})
self.assertEqual(main.old_files(root, "*.jsonl", NOW), [kept])
def test_reads_the_archive_where_loop_claude_transcripts_puts_it(self):