Skip to content

Commit

Permalink
test: Add bad unicode desktop file
Browse files Browse the repository at this point in the history
  • Loading branch information
danigm committed Aug 7, 2024
1 parent c164039 commit b63f875
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
13 changes: 3 additions & 10 deletions test/files/rpmlint-test.desktop
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
[Desktop Entry]
Name=rpmlint-test
Name[de]=rpmlint-test umlaut äöü
Name[x-test]=xxrpmlint-testxx
MimeType=application/x-rpm;
Name[de]=rpmlint-test umlaut äöü
Exec=rpmlint-test file.file
Icon=chameleon_v_balíku
Icon=chameleon_v_baliku
Type=Application
InitialPreference=5
NoDisplay=false
GenericName=rpmlint testcase
GenericName[x-test]=xxrpmlint testcasexx
Categories=System;PackageManager;
Keywords=software;package;
Keywords[x-test]=xxsoftwarexx;xxpackagexx;
Categories=Game;Amusement;
18 changes: 8 additions & 10 deletions test/test_menuxdg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# TODO: Add MXDG4 when the test is corrected
from mockdata.mock_menuxdg import MENUXDG, MENUXDG1, MENUXDG2, MENUXDG3, MENUXDG5
from mockdata.mock_menuxdg import MENUXDG, MENUXDG1, MENUXDG2, MENUXDG3, MENUXDG4, MENUXDG5
import pytest
from rpmlint.checks.MenuXDGCheck import MenuXDGCheck
from rpmlint.filter import Filter
Expand Down Expand Up @@ -56,14 +55,13 @@ def test_missing_header(package, menuxdgcheck):
assert 'invalid-desktopfile' in out


# TODO: Correct this test.
# @pytest.mark.skipif(not HAS_DESKTOP_FILE_UTILS, reason='Optional dependency desktop-file-utils not installed')
# @pytest.mark.parametrize('package', [MENUXDG4])
# def test_bad_unicode(package, menuxdgcheck):
# output, test = menuxdgcheck
# test.check(package)
# out = output.print_results(output.results)
# assert 'non-utf8-desktopfile' in out
@pytest.mark.skipif(not HAS_DESKTOP_FILE_UTILS, reason='Optional dependency desktop-file-utils not installed')
@pytest.mark.parametrize('package', [MENUXDG4])
def test_bad_unicode(package, menuxdgcheck):
output, test = menuxdgcheck
test.check(package)
out = output.print_results(output.results)
assert 'non-utf8-desktopfile' in out


@pytest.mark.skipif(not HAS_DESKTOP_FILE_UTILS, reason='Optional dependency desktop-file-utils not installed')
Expand Down

0 comments on commit b63f875

Please sign in to comment.