fix: 覆盖重生成失败后不再重复已成功日期
This commit is contained in:
@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user