(
template_path: str,
tmp_path_factory: pytest.TempPathFactory,
monkeypatch: pytest.MonkeyPatch,
)
| 40 | |
| 41 | |
| 42 | def test_api( |
| 43 | template_path: str, |
| 44 | tmp_path_factory: pytest.TempPathFactory, |
| 45 | monkeypatch: pytest.MonkeyPatch, |
| 46 | ) -> None: |
| 47 | tmp, dst = map(tmp_path_factory.mktemp, ["tmp", "dst"]) |
| 48 | _git = git["-C", dst] |
| 49 | # Mock tmp dir to assert it ends up clean |
| 50 | monkeypatch.setattr("tempfile.tempdir", str(tmp)) |
| 51 | # Copy |
| 52 | run_copy(template_path, dst, vcs_ref="v1", quiet=True, defaults=True) |
| 53 | assert (dst / "fav.txt").read_text() == "Copier" |
| 54 | assert not (dst / "v2").exists() |
| 55 | _git("init") |
| 56 | _git("add", "-A") |
| 57 | _git("commit", "-m", "Initial commit") |
| 58 | empty_dir(tmp) |
| 59 | # Recopy |
| 60 | run_recopy(dst, vcs_ref="v1", quiet=True, defaults=True) |
| 61 | assert (dst / "fav.txt").read_text() == "Copier" |
| 62 | assert not (dst / "v2").exists() |
| 63 | empty_dir(tmp) |
| 64 | # Update |
| 65 | run_update(dst, quiet=True, defaults=True, overwrite=True) |
| 66 | assert (dst / "fav.txt").read_text() == "Copier" |
| 67 | assert (dst / "v2").read_text() == "true" |
| 68 | empty_dir(tmp) |
| 69 | |
| 70 | |
| 71 | def test_cli( |
nothing calls this directly
no test coverage detected