File: test_genericpkgctx.py

package info (click to toggle)
python-auditwheel 6.6.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 980 kB
  • sloc: python: 6,165; ansic: 304; cpp: 66; sh: 28; makefile: 25; f90: 12
file content (25 lines) | stat: -rw-r--r-- 631 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pytest

from auditwheel.genericpkgctx import InGenericPkgCtx


def test_unknown_extension(tmp_path):
    file = tmp_path / "foo.txt"
    file.touch()
    with pytest.raises(ValueError, match=r".*File formats supported.*"):
        InGenericPkgCtx(file)


def test_conda_outpath(tmp_path):
    file = tmp_path / "foo.tar.bz2"
    file.touch()
    out = tmp_path / "out.tar.bz2"
    with pytest.raises(NotImplementedError):
        InGenericPkgCtx(file, out)


@pytest.mark.parametrize("ext", ["whl", "tar.bz2"])
def test_valid_ext(tmp_path, ext):
    file = tmp_path / f"foo.{ext}"
    file.touch()
    InGenericPkgCtx(file)