MCPcopy Index your code
hub / github.com/idank/explainshell / test_stats_counts

Function test_stats_counts

tests/test_postprocess_ubuntu_archive.py:183–205  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

181
182
183def 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
208def test_missing_section_handled(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 3

postprocessFunction · 0.90
_make_srcFunction · 0.85
_writeFunction · 0.85

Tested by

no test coverage detected