def test_cleanup(directory, monkeypatch): rm_path = None def fake_git_rm(path): nonlocal rm_path rm_path = path monkeypatch.setattr(ann, 'git_rm', fake_git_rm) fixes = directory / '2 Fixes' fixes.mkdir() fix1 = fixes / '1.md' fix1.write_text('Fix 1', encoding='utf-8') results = ann.gather(directory) assert len(results) == 1 ann.cleanup(results) section, entries = results.pop() assert len(entries) == 1 assert rm_path == entries[0].path
def test_cleanup(directory, monkeypatch): rm_path = None def fake_git_rm(path): nonlocal rm_path rm_path = path monkeypatch.setattr(ann, "git_rm", fake_git_rm) fixes = directory / "2 Fixes" fixes.mkdir() fix1 = fixes / "1.md" fix1.write_text("Fix 1", encoding="utf-8") results = ann.gather(directory) assert len(results) == 1 ann.cleanup(results) section, entries = results.pop() assert len(entries) == 1 assert rm_path == entries[0].path