tests/aliases.py

Thu, 26 Aug 2021 22:04:33 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 26 Aug 2021 22:04:33 +0300
changeset 152
5e347a96869a
parent 73
9664583cd1c9
permissions
-rw-r--r--

removed some alias tests that aren't mandated by the official header specification

from testsuite import problem_type, report_problem
import linetypes

@problem_type(
    'alias-not-prefixed-with-equals',
    severity = 'hold',
    message = 'description of alias files must start with a "="',
)
def alias_tests(model):
    if model.header.valid and 'Alias' in model.header.qualifiers:
        if not model.header.description.startswith('='):
            yield report_problem(
                'alias-not-prefixed-with-equals',
                bad_object = model.body[0],
            )

manifest = {
    'tests': [
        alias_tests
    ],
}

mercurial