(tmp_path: Path)
| 181 | |
| 182 | |
| 183 | def test_stats_counts(tmp_path: Path) -> None: |
| 184 | src = _make_src(tmp_path) |
| 185 | # 2 regular files |
| 186 | _write(src / "man1" / "a.1.gz") |
| 187 | _write(src / "man8" / "b.8.gz") |
| 188 | # 1 valid same-section symlink |
| 189 | os.symlink("a.1.gz", src / "man1" / "alias-a.1.gz") |
| 190 | # 1 valid cross-section symlink |
| 191 | _write(src / "man1" / "rip.1.gz") |
| 192 | os.symlink("../man1/rip.1.gz", src / "man8" / "cross.8.gz") |
| 193 | # 1 broken symlink |
| 194 | os.symlink("missing.1.gz", src / "man1" / "broken.1.gz") |
| 195 | # 1 nested dir |
| 196 | (src / "man1" / "subdir").mkdir() |
| 197 | |
| 198 | dst = tmp_path / "dst" |
| 199 | stats = postprocess(src, dst) |
| 200 | |
| 201 | assert stats.files_copied == 3 |
| 202 | assert stats.symlinks_copied == 1 |
| 203 | assert stats.symlinks_rewritten == 1 |
| 204 | assert stats.symlinks_skipped == 1 |
| 205 | assert stats.dirs_skipped == 1 |
| 206 | |
| 207 | |
| 208 | def test_missing_section_handled(tmp_path: Path) -> None: |
nothing calls this directly
no test coverage detected