diff --git a/src/bggpipe/export.py b/src/bggpipe/export.py index 3051012..98fcf60 100644 --- a/src/bggpipe/export.py +++ b/src/bggpipe/export.py @@ -743,8 +743,9 @@ def run_export( for line in failures: typer.echo(f" warning: cover not fetched — {line}") stale_note = f", {removed} stale page(s) removed" if removed else "" + shelves_note = " + the shelves page" if units else "" 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"{len(failures)} failed — re-run to retry{stale_note})" ) @@ -753,4 +754,5 @@ def run_export( "downloaded": downloaded, "failures": len(failures), "removed": removed, + "shelves": bool(units), } diff --git a/tests/test_export.py b/tests/test_export.py index dcf4f70..8154888 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -82,7 +82,13 @@ def test_export_writes_pages_art_and_no_shelf_photos(tmp_path): summary = run_export( 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() 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": ""}}) 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() assert "Den Kallax" in shelves and "the wall behind the couch" in shelves