Skip to content

Commit

Permalink
Replace bin in test_icon_sizes.py
Browse files Browse the repository at this point in the history
Also, creating a mock file to improve code cleanup of the test_icon_sizes.py file.
  • Loading branch information
i12momal committed Aug 12, 2024
1 parent 7aebc73 commit 6f8a204
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
11 changes: 11 additions & 0 deletions test/mockdata/mock_icon_sizes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from Testing import get_tested_mock_package

ICONSIZES = get_tested_mock_package(
files={
'/usr/share/tasque/icons/hicolor/16x16/status/tasque-note.png': {
'metadata': {
'magic': '22 x 22'
}
}
}
)
9 changes: 5 additions & 4 deletions test/test_icon_sizes.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from mockdata.mock_icon_sizes import ICONSIZES
import pytest
from rpmlint.checks.IconSizesCheck import IconSizesCheck
from rpmlint.filter import Filter

from Testing import CONFIG, get_tested_package
from Testing import CONFIG


@pytest.fixture(scope='function', autouse=True)
Expand All @@ -13,9 +14,9 @@ def iconsizescheck():
return output, test


@pytest.mark.parametrize('package', ['binary/tasque'])
def test_icon_sizes(tmp_path, package, iconsizescheck):
@pytest.mark.parametrize('package', [ICONSIZES])
def test_icon_sizes(package, iconsizescheck):
output, test = iconsizescheck
test.check(get_tested_package(package, tmp_path))
test.check(package)
out = output.print_results(output.results)
assert 'E: wrong-icon-size /usr/share/tasque/icons/hicolor/16x16/status/tasque-note.png expected: 16x16 actual: 22x22' in out

0 comments on commit 6f8a204

Please sign in to comment.