MCPcopy
hub / github.com/copier-org/copier / test_messages_with_included_text

Function test_messages_with_included_text

tests/test_output.py:214–350  ·  view source on GitHub ↗
(
    tmp_path_factory: pytest.TempPathFactory,
    capsys: pytest.CaptureFixture[str],
    spawn: Spawn,
    interactive: bool,
)

Source from the content-addressed store, hash-verified

212
213@pytest.mark.parametrize("interactive", [False, True])
214def 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(

Callers

nothing calls this directly

Calls 6

run_copyFunction · 0.90
run_recopyFunction · 0.90
run_updateFunction · 0.90
build_file_treeFunction · 0.85
spawnFunction · 0.85
expect_promptFunction · 0.85

Tested by

no test coverage detected