The export summary admits the shelves page exists
Eric re-exported to see the new shelves page, got the same summary line as always, and reasonably concluded nothing happened — while the wall page sat freshly written on disk. A feature that ships silently looks like a no-op. The echo now reads "exported N game page(s) + the shelves page" and the summary dict carries shelves: bool, pinned by test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g
This commit is contained in:
co-authored by
Claude Fable 5
parent
10f99e23f5
commit
79d42c43ab
@@ -743,8 +743,9 @@ def run_export(
|
|||||||
for line in failures:
|
for line in failures:
|
||||||
typer.echo(f" warning: cover not fetched — {line}")
|
typer.echo(f" warning: cover not fetched — {line}")
|
||||||
stale_note = f", {removed} stale page(s) removed" if removed else ""
|
stale_note = f", {removed} stale page(s) removed" if removed else ""
|
||||||
|
shelves_note = " + the shelves page" if units else ""
|
||||||
typer.echo(
|
typer.echo(
|
||||||
f"exported {len(games)} game page(s) to {out_dir} "
|
f"exported {len(games)} game page(s){shelves_note} to {out_dir} "
|
||||||
f"({downloaded} cover(s) downloaded, "
|
f"({downloaded} cover(s) downloaded, "
|
||||||
f"{len(failures)} failed — re-run to retry{stale_note})"
|
f"{len(failures)} failed — re-run to retry{stale_note})"
|
||||||
)
|
)
|
||||||
@@ -753,4 +754,5 @@ def run_export(
|
|||||||
"downloaded": downloaded,
|
"downloaded": downloaded,
|
||||||
"failures": len(failures),
|
"failures": len(failures),
|
||||||
"removed": removed,
|
"removed": removed,
|
||||||
|
"shelves": bool(units),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,13 @@ def test_export_writes_pages_art_and_no_shelf_photos(tmp_path):
|
|||||||
summary = run_export(
|
summary = run_export(
|
||||||
cfg, out, title="Test Shelves", fetch=_cdn(log), sleep=lambda s: None
|
cfg, out, title="Test Shelves", fetch=_cdn(log), sleep=lambda s: None
|
||||||
)
|
)
|
||||||
assert summary == {"games": 3, "downloaded": 3, "failures": 0, "removed": 0}
|
assert summary == {
|
||||||
|
"games": 3,
|
||||||
|
"downloaded": 3,
|
||||||
|
"failures": 0,
|
||||||
|
"removed": 0,
|
||||||
|
"shelves": False,
|
||||||
|
}
|
||||||
|
|
||||||
index = (out / "index.html").read_text()
|
index = (out / "index.html").read_text()
|
||||||
assert "Test Shelves" in index and "Powered by BGG" in index
|
assert "Test Shelves" in index and "Powered by BGG" in index
|
||||||
@@ -384,7 +390,8 @@ def test_shelves_export_and_optout(tmp_path):
|
|||||||
)
|
)
|
||||||
save_locations(cfg, {"240:24621": {"opening_id": "den-b1", "note": ""}})
|
save_locations(cfg, {"240:24621": {"opening_id": "den-b1", "note": ""}})
|
||||||
out = tmp_path / "site"
|
out = tmp_path / "site"
|
||||||
run_export(cfg, out, fetch=_cdn([]), sleep=lambda s: None)
|
summary = run_export(cfg, out, fetch=_cdn([]), sleep=lambda s: None)
|
||||||
|
assert summary["shelves"] is True # the run SAYS the wall shipped
|
||||||
|
|
||||||
shelves = (out / "shelves" / "index.html").read_text()
|
shelves = (out / "shelves" / "index.html").read_text()
|
||||||
assert "Den Kallax" in shelves and "the wall behind the couch" in shelves
|
assert "Den Kallax" in shelves and "the wall behind the couch" in shelves
|
||||||
|
|||||||
Reference in New Issue
Block a user