aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/AreaOfInterest/AOIFeatures.py
diff options
context:
space:
mode:
authorThéo de la Hogue2023-06-20 18:25:50 +0200
committerThéo de la Hogue2023-06-20 18:25:50 +0200
commitbae4435a0a97cb0ae0fcea2f172d25082ae12223 (patch)
treec616211f3bce0c7bf7a79e6353e7f243ce00ac25 /src/argaze.test/AreaOfInterest/AOIFeatures.py
parent106c281870aaa85583740f981986715a60a59d89 (diff)
downloadargaze-bae4435a0a97cb0ae0fcea2f172d25082ae12223.zip
argaze-bae4435a0a97cb0ae0fcea2f172d25082ae12223.tar.gz
argaze-bae4435a0a97cb0ae0fcea2f172d25082ae12223.tar.bz2
argaze-bae4435a0a97cb0ae0fcea2f172d25082ae12223.tar.xz
Updating test.
Diffstat (limited to 'src/argaze.test/AreaOfInterest/AOIFeatures.py')
-rw-r--r--src/argaze.test/AreaOfInterest/AOIFeatures.py25
1 files changed, 18 insertions, 7 deletions
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."""