(tmp_path: Path, _tmp_extract_dir: str)
| 31 | |
| 32 | |
| 33 | def test_tar_normal(tmp_path: Path, _tmp_extract_dir: str) -> None: |
| 34 | tar_path = str(tmp_path / "normal.tar") |
| 35 | with tarfile.open(name=tar_path, mode="w") as tf: |
| 36 | data = b"hello world" |
| 37 | info = tarfile.TarInfo(name="hello.txt") |
| 38 | info.size = len(data) |
| 39 | tf.addfile(tarinfo=info, fileobj=io.BytesIO(data)) |
| 40 | |
| 41 | result = extractall(path=tar_path, to=_tmp_extract_dir) |
| 42 | |
| 43 | assert os.path.exists(os.path.join(_tmp_extract_dir, "hello.txt")) |
| 44 | assert len(result) == 1 |
| 45 | |
| 46 | |
| 47 | def test_zip_path_traversal(tmp_path: Path, _tmp_extract_dir: str) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…