From b14971af9a3e6cb4a36498bbf92a1a73ee199fab Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Mon, 4 Dec 2023 20:15:53 -0600 Subject: [PATCH] Update test_direct_api.py, add a few more tests --- tests/test_direct_api.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_direct_api.py b/tests/test_direct_api.py index 2f710e79..efbfc668 100644 --- a/tests/test_direct_api.py +++ b/tests/test_direct_api.py @@ -1531,6 +1531,9 @@ def test_location_parameters(self): with self.assertRaises(TypeError): Location((10, 20, 30),(30, 20, 10),(10, 20, 30)) + with self.assertRaises(TypeError): + Location(Intrinsic.XYZ) + def test_location_repr_and_str(self): self.assertEqual( repr(Location()), "(p=(0.00, 0.00, 0.00), o=(-0.00, 0.00, -0.00))" @@ -2521,13 +2524,16 @@ def test_rotation_parameters(self): self.assertVectorAlmostEquals(r.orientation, (10, 20, 30), 5) r = Rotation(10, Y=20, Z=30) self.assertVectorAlmostEquals(r.orientation, (10, 20, 30), 5) + r = Rotation((10, 20, 30)) + self.assertVectorAlmostEquals(r.orientation, (10, 20, 30), 5) r = Rotation(10, 20, 30, Intrinsic.XYZ) self.assertVectorAlmostEquals(r.orientation, (10, 20, 30), 5) r = Rotation((30, 20, 10), Extrinsic.ZYX) self.assertVectorAlmostEquals(r.orientation, (10, 20, 30), 5) with self.assertRaises(TypeError): Rotation(x=10) - + with self.assertRaises(ValueError): + Rotation(1,2,3,4,5) class TestShape(DirectApiTestCase): """Misc Shape tests"""