Wed, 24 Jan 2018 23:14:01 +0200
Fix math domain errors in vector_angle
25 | 1 | from testsuite import warning |
2 | ||
3 | def colours_test(model): | |
26
7c263b864371
Added command line option to list all checks.
Santeri Piippo
parents:
25
diff
changeset
|
4 | ''' Checks that all colours used in the part model are valid. ''' |
25 | 5 | yield from ( |
6 | warning(element, 'bad-colour', colour_index = element.colour.index) | |
7 | for element in model.body | |
8 | if hasattr(element, 'colour') and not element.colour.is_valid | |
9 | ) | |
10 | ||
11 | manifest = { | |
12 | 'tests': { | |
13 | 'colour-validity': colours_test, | |
14 | }, | |
15 | 'messages': { | |
16 | 'bad-colour': lambda colour_index: str.format( | |
17 | 'invalid colour {}', | |
18 | colour_index, | |
19 | ), | |
20 | }, | |
21 | } |