tests/misc.py

changeset 74
831d9f81a48c
parent 71
4e24867a0110
child 75
3ec747dfbfb9
--- a/tests/misc.py	Sun Jun 23 00:38:01 2019 +0300
+++ b/tests/misc.py	Sun Jun 23 00:42:34 2019 +0300
@@ -145,6 +145,20 @@
             if is_line and element.colour.index != 24:
                 yield report_problem('bad-colour-24-line', bad_object = element)
 
+@problem_type('moved-to-with-extension',
+    severity = 'hold',
+    message = 'moved-to files must not contain the '
+        '".dat"-extension in the description',
+)
+def moved_to_with_extension_test(model):
+    if model.header.valid \
+    and model.header.description.startswith('~Moved to') \
+    and '.dat' in model.header.description:
+        yield report_problem(
+            'moved-to-with-extension',
+            bad_object = model.body[0],
+        )
+
 manifest = {
     'tests': [
         colours_test,
@@ -156,5 +170,6 @@
         header_bfc_test,
         keywords_tests,
         colour_24_test,
+        moved_to_with_extension_test,
     ],
 }

mercurial