diff options
Diffstat (limited to 'test/test_LSB.py')
-rw-r--r-- | test/test_LSB.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/test_LSB.py b/test/test_LSB.py new file mode 100644 index 0000000..d5fbb57 --- /dev/null +++ b/test/test_LSB.py @@ -0,0 +1,35 @@ +import pytest +from rpmlint.checks.LSBCheck import LSBCheck +from rpmlint.filter import Filter + +from Testing import CONFIG, get_tested_package + + +@pytest.fixture(scope='function', autouse=True) +def lsbcheck(): + CONFIG.info = True + output = Filter(CONFIG) + test = LSBCheck(CONFIG, output) + return output, test + + +@pytest.mark.parametrize('package', ['binary/fPing']) +def test_LSB_compliance(tmp_path, package, lsbcheck): + """ + Check that the package name, version and release number are LSB compliant. + """ + output, test = lsbcheck + test.check(get_tested_package(package, tmp_path)) + out = output.print_results(output.results) + + # Check invalid package name + assert 'non-lsb-compliant-package-name' in out + assert 'package name contains an illegal character' in out + + # Check invalid package version + assert 'non-lsb-compliant-version' in out + assert 'version number contains an illegal character' in out + + # Check invalid package release + assert 'non-lsb-compliant-release' in out + assert 'release number contains an illegal character' in out |