(tmp_path_factory: pytest.TempPathFactory)
| 452 | |
| 453 | |
| 454 | def test_commit_hash(tmp_path_factory: pytest.TempPathFactory) -> None: |
| 455 | src, dst = map(tmp_path_factory.mktemp, ("src", "dst")) |
| 456 | build_file_tree( |
| 457 | { |
| 458 | src / "commit.jinja": "{{_copier_conf.vcs_ref_hash}}", |
| 459 | src / "tag.jinja": "{{_copier_answers._commit}}", |
| 460 | } |
| 461 | ) |
| 462 | with local.cwd(src): |
| 463 | git("init") |
| 464 | git("add", "-A") |
| 465 | git("commit", "-m1") |
| 466 | git("tag", "1.0") |
| 467 | commit = git("rev-parse", "HEAD").strip() |
| 468 | copier.run_copy(str(src), dst) |
| 469 | assert (dst / "tag").read_text() == "1.0" |
| 470 | assert (dst / "commit").read_text() == commit |
| 471 | |
| 472 | |
| 473 | def test_value_with_forward_slash(tmp_path_factory: pytest.TempPathFactory) -> None: |
nothing calls this directly
no test coverage detected