diff options
author | Théo de la Hogue | 2023-06-20 18:25:50 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-06-20 18:25:50 +0200 |
commit | bae4435a0a97cb0ae0fcea2f172d25082ae12223 (patch) | |
tree | c616211f3bce0c7bf7a79e6353e7f243ce00ac25 /src/argaze.test | |
parent | 106c281870aaa85583740f981986715a60a59d89 (diff) | |
download | argaze-bae4435a0a97cb0ae0fcea2f172d25082ae12223.zip argaze-bae4435a0a97cb0ae0fcea2f172d25082ae12223.tar.gz argaze-bae4435a0a97cb0ae0fcea2f172d25082ae12223.tar.bz2 argaze-bae4435a0a97cb0ae0fcea2f172d25082ae12223.tar.xz |
Updating test.
Diffstat (limited to 'src/argaze.test')
-rw-r--r-- | src/argaze.test/ArFeatures.py | 3 | ||||
-rw-r--r-- | src/argaze.test/AreaOfInterest/AOIFeatures.py | 25 |
2 files changed, 20 insertions, 8 deletions
diff --git a/src/argaze.test/ArFeatures.py b/src/argaze.test/ArFeatures.py index 5da63d1..765e9cf 100644 --- a/src/argaze.test/ArFeatures.py +++ b/src/argaze.test/ArFeatures.py @@ -62,7 +62,8 @@ class TestArEnvironmentClass(unittest.TestCase): # Check AOI scene self.assertEqual(len(ar_scene.aoi_scene.items()), 1) - self.assertEqual(ar_scene.aoi_scene['Test'].size, 4) + self.assertEqual(ar_scene.aoi_scene['Test'].points_number, 4) + self.assertIsNone(numpy.testing.assert_array_equal(ar_scene.aoi_scene['Test'].size, [1., 1., 0.])) # Check ArScene self.assertEqual(ar_scene.angle_tolerance, 1.0) diff --git a/src/argaze.test/AreaOfInterest/AOIFeatures.py b/src/argaze.test/AreaOfInterest/AOIFeatures.py index f3e5fd8..586d2bd 100644 --- a/src/argaze.test/AreaOfInterest/AOIFeatures.py +++ b/src/argaze.test/AreaOfInterest/AOIFeatures.py @@ -30,8 +30,10 @@ class TestAreaOfInterestClass(unittest.TestCase): self.assertFalse(aoi_1D.empty) self.assertEqual(aoi_1D.dimension, 1) - self.assertEqual(aoi_1D.size, 1) - self.assertEqual(aoi_1D.center, [0]) + self.assertEqual(aoi_1D.points_number, 1) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_1D.bounds, [[0], [0]])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_1D.center, [0])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_1D.size, [0])) with self.assertRaises(AssertionError): self.assertEqual(aoi_1D.bounding_box, 1) @@ -41,8 +43,10 @@ class TestAreaOfInterestClass(unittest.TestCase): self.assertFalse(aoi_1D.empty) self.assertEqual(aoi_1D.dimension, 1) - self.assertEqual(aoi_1D.size, 2) - self.assertEqual(aoi_1D.center, [0.5]) + self.assertEqual(aoi_1D.points_number, 2) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_1D.bounds, [[0], [1]])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_1D.center, [0.5])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_1D.size, [1])) with self.assertRaises(AssertionError): self.assertEqual(aoi_1D.bounding_box, 1) @@ -52,16 +56,23 @@ class TestAreaOfInterestClass(unittest.TestCase): self.assertFalse(aoi_2D.empty) self.assertEqual(aoi_2D.dimension, 2) - self.assertEqual(aoi_2D.size, 4) + self.assertEqual(aoi_2D.points_number, 4) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_2D.bounds, [[0, 0], [1, 1]])) self.assertIsNone(numpy.testing.assert_array_equal(aoi_2D.center, [0.5, 0.5])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_2D.size, [1, 1])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_2D.bounding_box, [[0, 0], [1, 0], [1, 1], [0, 1]])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_2D.bounding_box_size, [1, 1])) # Check 8 points 3D AreaOfInterest creation aoi_3D = AOIFeatures.AreaOfInterest([[0, 0, 0], [0, 1, 0], [1, 0, 0], [1, 1, 0], [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]]) self.assertFalse(aoi_3D.empty) self.assertEqual(aoi_3D.dimension, 3) - self.assertEqual(aoi_3D.size, 8) + self.assertEqual(aoi_3D.points_number, 8) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_3D.bounds, [[0, 0, 0], [1, 1, 1]])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_3D.center, [0.5, 0.5, 0.5])) + self.assertIsNone(numpy.testing.assert_array_equal(aoi_3D.size, [1, 1, 1])) with self.assertRaises(AssertionError): self.assertEqual(aoi_3D.bounding_box, 1) @@ -87,7 +98,7 @@ class TestAreaOfInterestClass(unittest.TestCase): aoi_2D_float = AOIFeatures.AreaOfInterest([[0, 0], [0, math.pi], [math.pi, 0], [math.pi, math.pi]]) self.assertEqual(str(aoi_2D_float), f'[[0.0, 0.0], [0.0, {str(math.pi)}], [{str(math.pi)}, 0.0], [{str(math.pi)}, {str(math.pi)}]]') - + def test_clockwise(self): """Test AreaOfInterest clockwise method.""" |