(tmp_path: Path)
| 149 | |
| 150 | |
| 151 | def test_idempotent(tmp_path: Path) -> None: |
| 152 | src = _make_src(tmp_path) |
| 153 | _write(src / "man1" / "tar.1.gz", "tar-data") |
| 154 | os.symlink("tar.1.gz", src / "man1" / "gtar.1.gz") |
| 155 | os.symlink("nonexistent.1.gz", src / "man1" / "broken.1.gz") |
| 156 | |
| 157 | dst = tmp_path / "dst" |
| 158 | |
| 159 | stats1 = postprocess(src, dst) |
| 160 | stats2 = postprocess(src, dst) |
| 161 | |
| 162 | assert stats1 == stats2 |
| 163 | assert (dst / "1" / "tar.1.gz").read_text() == "tar-data" |
| 164 | result = dst / "1" / "gtar.1.gz" |
| 165 | assert result.is_symlink() |
| 166 | assert os.readlink(result) == "tar.1.gz" |
| 167 | assert not (dst / "1" / "broken.1.gz").exists() |
| 168 | |
| 169 | |
| 170 | def test_dry_run(tmp_path: Path) -> None: |
nothing calls this directly
no test coverage detected