PixelForge / imageforge /backend /tests /test_maintenance.py
Gregorfun's picture
Initial commit
32c5da4
from pathlib import Path
from backend.app.storage.maintenance import cleanup_outputs
def test_cleanup_outputs_removes_old(tmp_path: Path, monkeypatch) -> None:
old = tmp_path / "2000-01-01"
old.mkdir(parents=True)
(old / "x.txt").write_text("x", encoding="utf-8")
monkeypatch.setattr("backend.app.storage.maintenance.OUTPUT_DIR", tmp_path)
removed = cleanup_outputs(30)
assert removed >= 1