feat: schedule cover cache maintenance
CI / test (push) Successful in 5m25s

This commit is contained in:
strsv committed 2026-11-06 21:44:48 +03:00
1 parent 2dbe457836
commit d860157540
10 files changed
+91 -11

No files matched your search

+15
View File
@@ -34,6 +34,21 @@ class PruneTests(unittest.TestCase):
self.assertFalse(os.path.isfile(paths[1]))
self.assertTrue(os.path.isfile(marker))
def test_cleanup_negative_markers(self):
with tempfile.TemporaryDirectory() as tmp:
old = os.path.join(tmp, "1", ".missing")
new = os.path.join(tmp, "2", ".missing")
os.makedirs(os.path.dirname(old))
os.makedirs(os.path.dirname(new))
with open(old, "w", encoding="utf-8") as fh:
fh.write("0")
with open(new, "w", encoding="utf-8") as fh:
fh.write("0")
os.utime(old, (100, 100))
self.assertEqual(covers.cleanup_negative_markers(tmp, 3600), 1)
self.assertFalse(os.path.isfile(old))
self.assertTrue(os.path.isfile(new))
def test_stats(self):
with tempfile.TemporaryDirectory() as tmp:
with open(os.path.join(tmp, "a.jpg"), "wb") as fh: