-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1125 from rpm-software-management/iso-15924
Add iso_15924 to LANGUAGES
- Loading branch information
Showing
3 changed files
with
238 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import pytest | ||
from rpmlint.checks.I18NCheck import I18NCheck | ||
from rpmlint.filter import Filter | ||
|
||
from Testing import CONFIG, get_tested_mock_package | ||
|
||
|
||
@pytest.fixture(scope='function', autouse=True) | ||
def i18ncheck(): | ||
CONFIG.info = True | ||
output = Filter(CONFIG) | ||
test = I18NCheck(CONFIG, output) | ||
yield output, test | ||
|
||
|
||
@pytest.fixture | ||
def output(i18ncheck): | ||
output, _test = i18ncheck | ||
yield output | ||
|
||
|
||
@pytest.fixture | ||
def test(i18ncheck): | ||
_output, test = i18ncheck | ||
yield test | ||
|
||
|
||
@pytest.mark.parametrize('package', [ | ||
get_tested_mock_package(files=['/usr/share/locale/xx_ES/LC_MESSAGES/goodvibes.mo']), | ||
get_tested_mock_package(files=['/usr/share/locale/es_XX/LC_MESSAGES/goodvibes.mo']), | ||
get_tested_mock_package(files=['/usr/share/locale/xx/LC_MESSAGES/goodvibes.mo']), | ||
]) | ||
def test_i18n_invalid_lang(package, output, test): | ||
test.check(package) | ||
out = output.print_results(output.results) | ||
assert 'E: invalid-lc-messages-dir' in out | ||
|
||
|
||
@pytest.mark.parametrize('package', [ | ||
get_tested_mock_package(files=['/usr/share/locale/zh/LC_MESSAGES/goodvibes.mo']), | ||
get_tested_mock_package(files=['/usr/share/locale/zh_Hant/LC_MESSAGES/goodvibes.mo']), | ||
get_tested_mock_package(files=['/usr/share/locale/es_ES/LC_MESSAGES/goodvibes.mo']), | ||
get_tested_mock_package(files=['/usr/share/locale/zh_TW/LC_MESSAGES/goodvibes.mo']), | ||
get_tested_mock_package(files=['/usr/share/locale/pt_BR/LC_MESSAGES/goodvibes.mo']), | ||
]) | ||
def test_i18n_valid_lang(package, output, test): | ||
test.check(package) | ||
out = output.print_results(output.results) | ||
assert 'E: invalid-lc-messages-dir' not in out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters