Exemple #1
0
 def testPointNotInXY(self):
     assertThrows(lambda: Ray({"x": 0, "z": 0}, 0, 1), ValueError)
Exemple #2
0
 def testEmptyConstructor(self):
     assertThrows(lambda: Ray(), Exception)
Exemple #3
0
 def testAngleLessThan0(self):
     assertThrows(lambda: Ray({"x": 0, "y": 0}, -0.1, 1), ValueError)
Exemple #4
0
 def testDistanceCantBeLessThanZero(self):
     assertThrows(lambda: Ray({"x": 0, "y": 0}, 1, -1), ValueError)
Exemple #5
0
 def testTooManyVariablesThrows(self):
     assertThrows(lambda: Ray({"x": 0, "y": 0, "z": 0}, 0, 1), ValueError)
Exemple #6
0
 def testAngleGreaterThan2pi(self):
     assertThrows(lambda: Ray({"x": 0, "y": 0}, 2 * pi, 1), ValueError)
Exemple #7
0
 def testSingleVariableRayThrows(self):
     assertThrows(lambda: Ray({"x": 0}, 0, 1), ValueError)
 def testInvalidConstructorInteger(self):
     assertThrows(lambda: TropicalCurve(2), TypeError)
 def testTooManyVariables(self):
     x = Variable("x")
     y = Variable("y")
     z = Variable("z")
     assertThrows(lambda: TropicalCurve(x + y + z), ValueError)
 def testNotEnoughVariables(self):
     x = Variable("x")
     assertThrows(lambda: TropicalCurve(Polynomial(input=x)), ValueError)
 def testInvalidConstructorVariable(self):
     x = Variable("x")
     assertThrows(lambda: TropicalCurve(x), TypeError)