tests/misc.py

changeset 74
831d9f81a48c
parent 71
4e24867a0110
child 75
3ec747dfbfb9
equal deleted inserted replaced
73:9664583cd1c9 74:831d9f81a48c
143 if not is_line and element.colour.index == 24: 143 if not is_line and element.colour.index == 24:
144 yield report_problem('bad-colour-24-nonline', bad_object = element) 144 yield report_problem('bad-colour-24-nonline', bad_object = element)
145 if is_line and element.colour.index != 24: 145 if is_line and element.colour.index != 24:
146 yield report_problem('bad-colour-24-line', bad_object = element) 146 yield report_problem('bad-colour-24-line', bad_object = element)
147 147
148 @problem_type('moved-to-with-extension',
149 severity = 'hold',
150 message = 'moved-to files must not contain the '
151 '".dat"-extension in the description',
152 )
153 def moved_to_with_extension_test(model):
154 if model.header.valid \
155 and model.header.description.startswith('~Moved to') \
156 and '.dat' in model.header.description:
157 yield report_problem(
158 'moved-to-with-extension',
159 bad_object = model.body[0],
160 )
161
148 manifest = { 162 manifest = {
149 'tests': [ 163 'tests': [
150 colours_test, 164 colours_test,
151 syntax_errors, 165 syntax_errors,
152 bad_header, 166 bad_header,
154 physical_colours_test, 168 physical_colours_test,
155 unofficiality_test, 169 unofficiality_test,
156 header_bfc_test, 170 header_bfc_test,
157 keywords_tests, 171 keywords_tests,
158 colour_24_test, 172 colour_24_test,
173 moved_to_with_extension_test,
159 ], 174 ],
160 } 175 }

mercurial