Add test for summary-on-multiple-lines (#454).
This commit is contained in:
parent
80d4375f17
commit
0e6c7c7f17
|
@ -178,7 +178,7 @@ class TagsCheck(AbstractCheck):
|
||||||
typos = self.spellchecker.spell_check(summary, 'Summary({})', lang, pkgname, ignored_words)
|
typos = self.spellchecker.spell_check(summary, 'Summary({})', lang, pkgname, ignored_words)
|
||||||
for typo in typos.items():
|
for typo in typos.items():
|
||||||
self.output.add_info('E', pkg, 'spelling-error', typo)
|
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)
|
self.output.add_info('E', pkg, 'summary-on-multiple-lines', lang)
|
||||||
if (summary[0] != summary[0].upper() and
|
if (summary[0] != summary[0].upper() and
|
||||||
summary.partition(' ')[0] not in CAPITALIZED_IGNORE_LIST):
|
summary.partition(' ')[0] not in CAPITALIZED_IGNORE_LIST):
|
||||||
|
|
Binary file not shown.
|
@ -386,3 +386,12 @@ def test_package_dev_dependency(tmpdir, package, tagscheck):
|
||||||
assert 'E: devel-dependency glibc-devel' in out
|
assert 'E: devel-dependency glibc-devel' in out
|
||||||
# Test if a package does not have a Group tag
|
# Test if a package does not have a Group tag
|
||||||
assert 'W: non-standard-group Devel/Something' not in out
|
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
|
||||||
|
|
Loading…
Reference in New Issue