Debian Codegraph @

tests/unit/test_genericpkgctx.py

raw
1 import pytest
2
3 from auditwheel.genericpkgctx import InGenericPkgCtx
4
5
6 def test_unknown_extension(tmp_path):
7 file = tmp_path / "foo.txt"
8 file.touch()
9 with pytest.raises(ValueError, match=r".*File formats supported.*"):
10 InGenericPkgCtx(file)
11
12
13 def test_conda_outpath(tmp_path):
14 file = tmp_path / "foo.tar.bz2"
15 file.touch()
16 out = tmp_path / "out.tar.bz2"
17 with pytest.raises(NotImplementedError):
18 InGenericPkgCtx(file, out)
19
20
21 @pytest.mark.parametrize("ext", ["whl", "tar.bz2"])
22 def test_valid_ext(tmp_path, ext):
23 file = tmp_path / f"foo.{ext}"
24 file.touch()
25 InGenericPkgCtx(file)