Skip to content

Add per-field test matrix for every template#4

Merged
MrTango merged 1 commit into
mainfrom
add-per-field-value-matrix-tests
May 19, 2026
Merged

Add per-field test matrix for every template#4
MrTango merged 1 commit into
mainfrom
add-per-field-value-matrix-tests

Conversation

@MrTango
Copy link
Copy Markdown
Contributor

@MrTango MrTango commented May 19, 2026

Summary

  • New tests/test_field_value_matrix.py: data-driven matrix that exercises every free-text question across every template with deliberately hostile input (apostrophes, $, backticks, pipes, semicolons, parens, spaces, unicode), asserts copier exits 0, and asserts the value lands unmangled in the generated tree.
  • Adds a per-template default-baseline run for every template.
  • Adds in-process copier.run_copy() cases (main + sub) to mirror the plonecli entry point — not just the copier --data CLI path.
  • Fixes a real bug exposed by the matrix: all three theme templates (theme, theme_basic, theme_barceloneta) ignored theme_description and hardcoded the manifest.cfg description string. manifest.cfg.jinja now renders {{ theme_description }}.

Implements the Testing item in TODO.md. Motivation: the _tasks shell-quoting bug (apostrophe in a description aborted the run, fixed in #3) shipped only because every prior test relied on copier defaults for description/title fields. The matrix is the regression net for that whole class of bugs.

Test plan

  • uv run pytest tests/test_field_value_matrix.py — 49 new tests pass
  • uv run pytest — full suite (312 tests, 1 deselected integration test) passes
  • Manual verification that hostile input lands unmangled in generated files

Data-driven matrix in tests/test_field_value_matrix.py that exercises
every free-text question across every template with deliberately hostile
input (apostrophes, $, backticks, pipes, semicolons, parens, spaces,
unicode), asserts copier exits 0 and the value lands unmangled in the
generated tree, plus a per-template default-baseline run and in-process
copier.run_copy() cases mirroring the plonecli entry point.

The matrix exposed a real bug: all three theme templates ignored
theme_description and hardcoded the manifest.cfg description string.
Fixed manifest.cfg.jinja in theme, theme_basic, and theme_barceloneta
to render {{ theme_description }}.
@MrTango MrTango merged commit 9312d07 into main May 19, 2026
5 checks passed
@MrTango MrTango deleted the add-per-field-value-matrix-tests branch May 20, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant