Add per-field test matrix for every template#4
Merged
Conversation
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 }}.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.copier.run_copy()cases (main + sub) to mirror the plonecli entry point — not just thecopier --dataCLI path.theme,theme_basic,theme_barceloneta) ignoredtheme_descriptionand hardcoded the manifest.cfg description string.manifest.cfg.jinjanow renders{{ theme_description }}.Implements the
Testingitem inTODO.md. Motivation: the_tasksshell-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 passuv run pytest— full suite (312 tests, 1 deselected integration test) passes