tests/misc.py

changeset 50
0193f8820ba8
parent 48
38b0919c1934
child 62
f0a6bf48b05e
--- a/tests/misc.py	Tue May 28 19:10:52 2019 +0300
+++ b/tests/misc.py	Tue May 28 19:11:01 2019 +0300
@@ -44,6 +44,14 @@
             model.body[model.header.first_occurrence['part type']],
             'unofficial-type')
 
+def primitive_ccw_test(model):
+    if model.header.valid \
+    and model.header.filetype.endswith('Primitive') \
+    and model.header.bfc != 'CERTIFY CCW':
+        yield error(
+            model.body[model.header.first_occurrence['bfc']],
+            'primitive-bfc-ccw')
+
 manifest = {
     'tests': {
         'colour-validity': colours_test,
@@ -52,6 +60,7 @@
         'bfc-nocertify': nocertify_test,
         'physical-colour': physical_colours_test,
         'unofficial-type': unofficiality_test,
+        'primitive-ccw': primitive_ccw_test,
     },
     'messages': {
         'bad-colour': lambda colour_index: str.format(
@@ -69,5 +78,6 @@
         'bfc-nocertify': 'all new parts must be BFC certified',
         'physical-colour': 'no new physical colour parts are accepted',
         'unofficial-type': 'new parts must be unofficial',
+        'primitive-bfc-ccw': 'primitives must have CCW winding',
     },
 }

mercurial