fix: 覆盖重生成失败后不再重复已成功日期

This commit is contained in:
Benature
2026-11-29 20:24:37 +08:00
parent 16811d5ec8
commit e2efcf900e
3 changed files with 44 additions and 6 deletions

View File

@ -97,3 +97,19 @@ def test_backfill_does_not_probe_days_that_do_not_need_regeneration(tmp_path):
assert days == []
assert probes == [] # 已存在且无需重生成的日子不应触发拉取判断
def test_daily_overwrite_skips_dates_already_overwritten(tmp_path):
for day in (date(2026, 11, 11), date(2026, 11, 12)):
(tmp_path / f"{day.isoformat()}.md").write_text("旧日报", encoding="utf-8")
days = list(missing_message_dates(
date(2026, 11, 11),
date(2026, 11, 12),
lambda day: True,
lambda day: tmp_path / f"{day.isoformat()}.md",
daily_overwrite_from=date(2026, 11, 11),
already_overwritten={"2026-11-11"},
))
assert days == [date(2026, 11, 12)]