Skip to content

Commit

Permalink
test: Normalize mock_zypp_syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
danigm committed Sep 25, 2024
1 parent 85149e5 commit 0e16e88
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
24 changes: 8 additions & 16 deletions test/mockdata/mock_zypp_syntax.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
from Testing import get_tested_mock_package

ZYPPSYNTAX = get_tested_mock_package(

SyntaxPackageandPackage = get_tested_mock_package(
lazyload=True,
header={
'requires': [
'rpmlib(CompressedFileNames) <= 3.0.4-1',
'rpmlib(FileDigests) <= 4.6.0-1',
'rpmlib(PayloadFilesHavePrefix) <= 4.0-1',
'rpmlib(PayloadIsXz) <= 5.2-1',
'rpmlib(RichDependencies) <= 4.12.0-1',
],
'requires': [],
'supplements': ['packageand(c:d)'],
'recommends': ['packageand(a:b)'],
'suggests': ['(a and b)'],
Expand All @@ -19,15 +15,11 @@
},
)

ZYPPSYNTAX2 = get_tested_mock_package(

SyntaxAndPackage = get_tested_mock_package(
lazyload=True,
header={
'requires': [
'rpmlib(CompressedFileNames) <= 3.0.4-1',
'rpmlib(FileDigests) <= 4.6.0-1',
'rpmlib(PayloadFilesHavePrefix) <= 4.0-1',
'rpmlib(PayloadIsXz) <= 5.2-1',
'rpmlib(RichDependencies) <= 4.12.0-1',
],
'requires': [],
'supplements': ['(c and d)'],
'recommends': ['b'],
'suggests': ['(a and b)'],
Expand Down
9 changes: 6 additions & 3 deletions test/test_zypp_syntax.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from mockdata.mock_zypp_syntax import (ZYPPSYNTAX, ZYPPSYNTAX2)
from mockdata.mock_zypp_syntax import (
SyntaxPackageandPackage,
SyntaxAndPackage,
)
import pytest
from rpmlint.checks.ZyppSyntaxCheck import ZyppSyntaxCheck
from rpmlint.filter import Filter
Expand Down Expand Up @@ -26,7 +29,7 @@ def test(zyppsyntaxcheck):
yield test


@pytest.mark.parametrize('package', [ZYPPSYNTAX])
@pytest.mark.parametrize('package', [SyntaxPackageandPackage])
def test_packageand(package, test, output):
test.check(package)
out = output.print_results(output.results)
Expand All @@ -37,7 +40,7 @@ def test_packageand(package, test, output):
assert 'suse-zypp-otherproviders otherproviders(yast2_theme)' in out


@pytest.mark.parametrize('package', [ZYPPSYNTAX2])
@pytest.mark.parametrize('package', [SyntaxAndPackage])
def test_packageand_ok(package, test, output):
test.check(package)
out = output.print_results(output.results)
Expand Down

0 comments on commit 0e16e88

Please sign in to comment.