added a test for ".dat"-extensions in the description

Sun, 23 Jun 2019 00:42:34 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 23 Jun 2019 00:42:34 +0300
changeset 74
831d9f81a48c
parent 73
9664583cd1c9
child 75
3ec747dfbfb9

added a test for ".dat"-extensions in the description

tests/misc.py file | annotate | diff | comparison | revisions
--- 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