(
tmp_path_factory: pytest.TempPathFactory,
capsys: pytest.CaptureFixture[str],
spawn: Spawn,
interactive: bool,
)
| 212 | |
| 213 | @pytest.mark.parametrize("interactive", [False, True]) |
| 214 | def test_messages_with_included_text( |
| 215 | tmp_path_factory: pytest.TempPathFactory, |
| 216 | capsys: pytest.CaptureFixture[str], |
| 217 | spawn: Spawn, |
| 218 | interactive: bool, |
| 219 | ) -> None: |
| 220 | src, dst = map(tmp_path_factory.mktemp, ["src", "dst"]) |
| 221 | |
| 222 | build_file_tree( |
| 223 | { |
| 224 | (src / "copier.yaml"): ( |
| 225 | """\ |
| 226 | project_name: |
| 227 | type: str |
| 228 | |
| 229 | _exclude: [".git", "*.md"] |
| 230 | _message_before_copy: "{% include 'message_before_copy.md.jinja' %}" |
| 231 | _message_after_copy: "{% include 'message_after_copy.md.jinja' %}" |
| 232 | _message_before_update: "{% include 'message_before_update.md.jinja' %}" |
| 233 | _message_after_update: "{% include 'message_after_update.md.jinja' %}" |
| 234 | """ |
| 235 | ), |
| 236 | (src / "message_before_copy.md.jinja"): ( |
| 237 | """\ |
| 238 | Thank you for using our template on {{ _copier_conf.os }} |
| 239 | """ |
| 240 | ), |
| 241 | (src / "message_after_copy.md.jinja"): ( |
| 242 | """\ |
| 243 | Project {{ project_name }} successfully created |
| 244 | """ |
| 245 | ), |
| 246 | (src / "message_before_update.md.jinja"): ( |
| 247 | """\ |
| 248 | Updating on {{ _copier_conf.os }} |
| 249 | """ |
| 250 | ), |
| 251 | (src / "message_after_update.md.jinja"): ( |
| 252 | """\ |
| 253 | Project {{ project_name }} successfully updated |
| 254 | """ |
| 255 | ), |
| 256 | (src / "{{ _copier_conf.answers_file }}.jinja"): ( |
| 257 | """\ |
| 258 | # Changes here will be overwritten by Copier |
| 259 | {{ _copier_answers|to_nice_yaml }} |
| 260 | """ |
| 261 | ), |
| 262 | (src / "version.txt"): "v1", |
| 263 | } |
| 264 | ) |
| 265 | with local.cwd(src): |
| 266 | git("init") |
| 267 | git("add", ".") |
| 268 | git("commit", "-m1") |
| 269 | git("tag", "v1") |
| 270 | |
| 271 | build_file_tree( |
nothing calls this directly
no test coverage detected