Example #1
0
def test_valid_license_exception(tmpdir, package, tagscheck):
    CONFIG.info = True
    CONFIG.configuration['ValidLicenseExceptions'] = ['389-exception']
    output = Filter(CONFIG)
    test = TagsCheck(CONFIG, output)
    test.check(get_tested_package(package, tmpdir))
    out = output.print_results(output.results)
    assert 'W: invalid-license-exception' not in out
Example #2
0
def test_package_dev_dependency(tmpdir, package, tagscheck):
    """Test if a package check,
    - in out,
        devel-dependency,
    - not in out,
        non-standard-group."""
    CONFIG.configuration['ValidGroups'] = ['Devel/Something']
    output = Filter(CONFIG)
    test = TagsCheck(CONFIG, output)
    test.check(get_tested_package(package, tmpdir))
    out = output.print_results(output.results)
    # Test if a package is not a devel package itself but requires a devel dependency
    assert 'E: devel-dependency glibc-devel' in out
    # Test if a package does not have a Group tag
    assert 'W: non-standard-group Devel/Something' not in out
Example #3
0
def test_check_non_standard_group(tmpdir, package, tagscheck):
    """Test if a package has check,
    - in out,
        non-standard-group
    - not in out,
        not-standard-release-extension."""
    CONFIG.configuration['ValidGroups'] = ['Devel/Something']
    CONFIG.configuration['ReleaseExtension'] = '0'
    output = Filter(CONFIG)
    test = TagsCheck(CONFIG, output)
    test.check(get_tested_package(package, tmpdir))
    out = output.print_results(output.results)
    # Test if a package has a different Group: tag value than ValidGroups = []
    assert 'W: non-standard-group non/standard/group' in out
    # Test if a package matches the Release tag regex
    assert 'not-standard-release-extension 0' not in out
Example #4
0
def test_check_invalid_license(tmpdir, package, tagscheck):
    """Test if a package check,
    - in out,
        invalid-license,
    - not in out,
        requires-on-release."""
    CONFIG.configuration['ValidLicenses'] = ['MIT']
    output = Filter(CONFIG)
    test = TagsCheck(CONFIG, output)
    test.check(get_tested_package(package, tmpdir))
    out = output.print_results(output.results)
    # Test if a package has a License: tag value different from
    # ValidLicense = [] list in configuration
    assert 'W: invalid-license Apache License' in out
    # Test if a package does not Requires: a specific version of a package
    assert 'W: requires-on-release' not in out
Example #5
0
def test_package_not_std_release_extension(tmpdir, package, tagscheck):
    """Test if package has check,
    - in out,
        not-standard-release-extension
    - not in out,
        invalid-license."""
    CONFIG.configuration['ReleaseExtension'] = 'hello$'
    CONFIG.configuration['ValidLicenses'] = ['Apache-2.0 License']
    output = Filter(CONFIG)
    test = TagsCheck(CONFIG, output)
    test.check(get_tested_package(package, tmpdir))
    out = output.print_results(output.results)
    # Test if a package has a ReleaseExtension regex does not match with the Release: tag value expression
    # i.e. Release tag value must not match regex expression 'hello$'
    assert 'W: not-standard-release-extension 1.1' in out
    # Test if a package does have the same License value as defined in the ValidLicense in configdefaults
    assert 'W: invalid-license Apache-2.0 License' not in out
Example #6
0
def tagscheck():
    CONFIG.info = True
    output = Filter(CONFIG)
    test = TagsCheck(CONFIG, output)
    return output, test