Files
cs249r_book/binder/tests/test_currency_generated_dirs.py
Vijay Janapa Reddi 5a66c935f1 Fix book build failures and harden book checks
- Vol II: close the margin note wrapping the storage-compute figure,
  move the bandwidth figure out of its callout, and separate the NPU
  figure from the preceding footnote so all three cross-references
  resolve; widen Table 11.3 so it stays inside the page trim.
- Landing pages: hide the download card, star counter, and podcast from
  EPUB output and point the cover and podcast at shared/assets.
- Vol I/II frontmatter image paths, table column widths, Vol III
  equation labels, Vol IV lint fixes and SVG newline repairs, and
  regenerated volume bibliographies.
- Bibliography integrity scan ignores math spans; currency check skips
  render caches; Prentice Hall joins the canonical publisher list.
- Unprefixed chapter URLs publish redirect stubs to numbered pages.
- Remove stray test files, duplicate quiz files, unused cover options,
  generated figure lists, and outdated review scripts; drop generator
  metadata from quiz files.
- Repoint documentation at current chapter paths and deduplicate
  pre-commit file patterns.
2026-09-12 09:17:53 +02:00

26 lines
987 B
Python

"""The currency check must not scan render caches left by a local build."""
from pathlib import Path
from checks.currency_style import iter_target_files
def test_render_caches_are_not_scanned(tmp_path: Path) -> None:
chapter = tmp_path / "vol1" / "01_intro" / "01_intro.qmd"
chapter.parent.mkdir(parents=True)
chapter.write_text("Costs are $5.\n", encoding="utf-8")
cache = tmp_path / ".quarto" / "idx" / "vol1" / "01_intro.qmd.json"
cache.parent.mkdir(parents=True)
cache.write_text('{"markdown": "5 USD"}\n', encoding="utf-8")
figures = tmp_path / "vol1" / "01_intro" / "01_intro_files" / "note.qmd"
figures.parent.mkdir(parents=True)
figures.write_text("5 USD\n", encoding="utf-8")
found = {p.relative_to(tmp_path).as_posix() for p in iter_target_files([tmp_path])}
assert "vol1/01_intro/01_intro.qmd" in found
assert not any(part.startswith(".quarto") for part in found)
assert not any("_files/" in part for part in found)