def test_rect_invalid(self): with self.assertRaises(ValidationError): is_rect('1px, 3px 2px, 4px')
def test_rect_valid(self): self.assertEqual(is_rect('rect(1px, 3px, 2px, 4px)'), Rect(1, 3, 2, 4))