| 1 from testsuite import warning |
1 from testsuite import warning |
| 2 |
2 |
| 3 def colours_test(model): |
3 def colours_test(model): |
| |
4 ''' Checks that all colours used in the part model are valid. ''' |
| 4 yield from ( |
5 yield from ( |
| 5 warning(element, 'bad-colour', colour_index = element.colour.index) |
6 warning(element, 'bad-colour', colour_index = element.colour.index) |
| 6 for element in model.body |
7 for element in model.body |
| 7 if hasattr(element, 'colour') and not element.colour.is_valid |
8 if hasattr(element, 'colour') and not element.colour.is_valid |
| 8 ) |
9 ) |