(tmp_path_factory: pytest.TempPathFactory)
| 34 | |
| 35 | @pytest.mark.impure |
| 36 | def test_updatediff(tmp_path_factory: pytest.TempPathFactory) -> None: |
| 37 | src, dst = map(tmp_path_factory.mktemp, ("src", "dst")) |
| 38 | # Prepare repo bundle |
| 39 | repo = src / "repo" |
| 40 | bundle = src / "demo_updatediff_repo.bundle" |
| 41 | last_commit = "" |
| 42 | build_file_tree( |
| 43 | { |
| 44 | (repo / ".copier-answers.yml.jinja"): ( |
| 45 | """\ |
| 46 | # Changes here will be overwritten by Copier |
| 47 | {{ _copier_answers|to_nice_yaml }} |
| 48 | """ |
| 49 | ), |
| 50 | (repo / "copier.yml"): ( |
| 51 | """\ |
| 52 | _envops: |
| 53 | "keep_trailing_newline": True |
| 54 | project_name: to become a pirate |
| 55 | author_name: Guybrush |
| 56 | """ |
| 57 | ), |
| 58 | (repo / "README.txt.jinja"): ( |
| 59 | """ |
| 60 | Let me introduce myself. |
| 61 | |
| 62 | My name is {{author_name}}, and my project is {{project_name}}. |
| 63 | |
| 64 | Thanks for your attention. |
| 65 | """ |
| 66 | ), |
| 67 | } |
| 68 | ) |
| 69 | with local.cwd(repo): |
| 70 | git("init") |
| 71 | git("add", ".") |
| 72 | git("commit", "-m", "Guybrush wants to be a pirate") |
| 73 | git("tag", "v0.0.1") |
| 74 | build_file_tree( |
| 75 | { |
| 76 | (repo / "copier.yml"): ( |
| 77 | """\ |
| 78 | _envops: |
| 79 | "keep_trailing_newline": True |
| 80 | project_name: to become a pirate |
| 81 | author_name: Guybrush |
| 82 | _migrations: |
| 83 | - version: v0.0.1 |
| 84 | when: "{{ _stage == 'before' }}" |
| 85 | command: touch before-v0.0.1 |
| 86 | - version: v0.0.1 |
| 87 | when: "{{ _stage == 'after' }}" |
| 88 | command: touch after-v0.0.1 |
| 89 | - version: v0.0.2 |
| 90 | when: "{{ _stage == 'before' }}" |
| 91 | command: touch before-v0.0.2 |
| 92 | - version: v0.0.2 |
| 93 | when: "{{ _stage == 'after' }}" |
nothing calls this directly
no test coverage detected