Tue, 23 Jan 2018 15:30:48 +0200
added test for collinearity, fixed bowtie test
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 | } |