Add test for summary-on-multiple-lines (#454).

This commit is contained in:
Martin Liska 2020-09-30 09:10:04 +02:00 committed by Tomáš Chvátal
parent 80d4375f17
commit 0e6c7c7f17
3 changed files with 10 additions and 1 deletions

View File

@ -178,7 +178,7 @@ class TagsCheck(AbstractCheck):
typos = self.spellchecker.spell_check(summary, 'Summary({})', lang, pkgname, ignored_words)
for typo in typos.items():
self.output.add_info('E', pkg, 'spelling-error', typo)
if '\n' in summary:
if any(nl in summary for nl in ('\n', '\r')):
self.output.add_info('E', pkg, 'summary-on-multiple-lines', lang)
if (summary[0] != summary[0].upper() and
summary.partition(' ')[0] not in CAPITALIZED_IGNORE_LIST):

Binary file not shown.

View File

@ -386,3 +386,12 @@ def test_package_dev_dependency(tmpdir, package, tagscheck):
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
@pytest.mark.parametrize('package', ['binary/summary-on-multiple-lines'])
def test_summary_on_multiple_lines(tmpdir, package, tagscheck):
# Test if a package has summary on multiple lines.
output, test = tagscheck
test.check(get_tested_package(package, tmpdir))
out = output.print_results(output.results)
assert 'E: summary-on-multiple-lines' in out