File size: 420 Bytes
32c5da4
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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