Example #1
0
    def testValidateCircle(self):
        c1 = Circle(0, 0, 2, 0, 0, 2, 3, 0, 0, 3)
        Validator.validateCircle(c1, "Circle unexpectedly invalid")

        self.assertRaises(
            ShapeException, Validator.validateCircle,
            "(0, 0, 2, 0, 0, 2, 3, 0, 0, 3)",
            "String \'(0, 0, 2, 0, 0, 2, 3, 0, 0, 3)\' is not a valid circle")
        self.assertRaises(ShapeException, Validator.validateCircle,
                          Point(1, 1), "Point is not a valid circle")
Example #2
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     Validator.validateCircle(self, "Circle is invalid")