diff options
author | Théo de la Hogue | 2024-03-12 15:31:55 +0100 |
---|---|---|
committer | Théo de la Hogue | 2024-03-12 15:31:55 +0100 |
commit | 182844cfbc1462c266245186f97f05986f0170ce (patch) | |
tree | 27f322e20ef5f20e3a5db8d454567add62df04e7 /src/argaze.test | |
parent | af7657659453b8cf19ce7be5447456c86b35d59c (diff) | |
download | argaze-182844cfbc1462c266245186f97f05986f0170ce.zip argaze-182844cfbc1462c266245186f97f05986f0170ce.tar.gz argaze-182844cfbc1462c266245186f97f05986f0170ce.tar.bz2 argaze-182844cfbc1462c266245186f97f05986f0170ce.tar.xz |
Fixing tests.
Diffstat (limited to 'src/argaze.test')
-rw-r--r-- | src/argaze.test/AreaOfInterest/AOI2DScene.py | 19 | ||||
-rw-r--r-- | src/argaze.test/AreaOfInterest/AOI3DScene.py | 19 | ||||
-rw-r--r-- | src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py | 10 | ||||
-rw-r--r-- | src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py | 2 | ||||
-rw-r--r-- | src/argaze.test/GazeFeatures.py | 16 |
5 files changed, 14 insertions, 52 deletions
diff --git a/src/argaze.test/AreaOfInterest/AOI2DScene.py b/src/argaze.test/AreaOfInterest/AOI2DScene.py index 10ff430..1649e54 100644 --- a/src/argaze.test/AreaOfInterest/AOI2DScene.py +++ b/src/argaze.test/AreaOfInterest/AOI2DScene.py @@ -177,25 +177,6 @@ class TestAOI2DSceneClass(unittest.TestCase): self.assertEqual(len(aoi_2d_scene_copy.items()), 1) self.assertEqual(list(aoi_2d_scene_copy.keys()), ["A"]) -class TestTimeStampedAOIScenesClass(unittest.TestCase): - """Test TimeStampedAOIScenes class.""" - - def test___setitem__(self): - """Test TimeStampedAOIScenes creation.""" - - aoi_2D_A = AOIFeatures.AreaOfInterest([[0, 0], [0, 1], [1, 1], [1, 0]]) - aoi_2D_B = AOIFeatures.AreaOfInterest([[1, 1], [1, 2], [2, 2], [2, 1]]) - aoi_2d_scene = AOI2DScene.AOI2DScene({"A": aoi_2D_A, "B": aoi_2D_B}) - - ts_aoi_scenes = AOIFeatures.TimeStampedAOIScenes() - - ts_aoi_scenes[0] = aoi_2d_scene - - # Check that only AOIScene can be added - with self.assertRaises(AssertionError): - - ts_aoi_scenes[1] = "This string is not an AOI2DScene" - if __name__ == '__main__': unittest.main()
\ No newline at end of file diff --git a/src/argaze.test/AreaOfInterest/AOI3DScene.py b/src/argaze.test/AreaOfInterest/AOI3DScene.py index d09f2a8..152f545 100644 --- a/src/argaze.test/AreaOfInterest/AOI3DScene.py +++ b/src/argaze.test/AreaOfInterest/AOI3DScene.py @@ -97,25 +97,6 @@ class TestAOI3DSceneClass(unittest.TestCase): self.assertEqual(len(aoi_3d_scene_copy.items()), 1) self.assertEqual(list(aoi_3d_scene_copy.keys()), ["A"]) -class TestTimeStampedAOIScenesClass(unittest.TestCase): - """Test TimeStampedAOIScenes class.""" - - def test___setitem__(self): - """Test TimeStampedAOIScenes creation.""" - - aoi_3D_A = AOIFeatures.AreaOfInterest([[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]) - aoi_3D_B = AOIFeatures.AreaOfInterest([[1, 1, 0], [1, 2, 0], [2, 2, 0], [2, 1, 0]]) - aoi_3d_scene = AOI3DScene.AOI3DScene({"A": aoi_3D_A, "B": aoi_3D_B}) - - ts_aoi_scenes = AOIFeatures.TimeStampedAOIScenes() - - ts_aoi_scenes[0] = aoi_3d_scene - - # Check that only AOIScene can be added - with self.assertRaises(AssertionError): - - ts_aoi_scenes[1] = "This string is not an AOI3DScene" - if __name__ == '__main__': unittest.main()
\ No newline at end of file diff --git a/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py index 1c54bd1..95453d2 100644 --- a/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py +++ b/src/argaze.test/GazeAnalysis/DispersionThresholdIdentification.py @@ -302,12 +302,12 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): fixation_C = DispersionThresholdIdentification.Fixation(ts_gaze_positions_C) # Check that fixation doesn't overlap - self.assertFalse(fixation_A.overlap(fixation_B)) - self.assertFalse(fixation_B.overlap(fixation_A)) + self.assertFalse(fixation_A.is_overlapping()(fixation_B)) + self.assertFalse(fixation_B.is_overlapping()(fixation_A)) # Check that fixation overlaps - self.assertTrue(fixation_B.overlap(fixation_C)) - self.assertTrue(fixation_C.overlap(fixation_B)) + self.assertTrue(fixation_B.is_overlapping()(fixation_C)) + self.assertTrue(fixation_C.is_overlapping()(fixation_B)) @unittest.skip("Fixation overlapping is not supported anymore.") def test_fixation_overlapping_identification(self): @@ -362,7 +362,7 @@ class TestDispersionThresholdIdentificationClass(unittest.TestCase): # Iterate on gaze positions for gaze_position in ts_gaze_positions: - finished_gaze_movement = gaze_movement_identifier.identify(gaze_position.timestamp, gaze_position, terminate=(gaze_position.timestamp == ts_gaze_positions[-1].timestamp)) + finished_gaze_movement = gaze_movement_identifier.identify(gaze_position, terminate=(gaze_position.timestamp == ts_gaze_positions[-1].timestamp)) if GazeFeatures.is_fixation(finished_gaze_movement): diff --git a/src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py b/src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py index 051265c..5dce9b2 100644 --- a/src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py +++ b/src/argaze.test/GazeAnalysis/VelocityThresholdIdentification.py @@ -300,7 +300,7 @@ class TestVelocityThresholdIdentificationClass(unittest.TestCase): # Iterate on gaze positions for gaze_position in ts_gaze_positions: - finished_gaze_movement = gaze_movement_identifier.identify(gaze_position.timestamp, gaze_position, terminate=(gaze_position.timestamp == ts_gaze_positions[-1])) + finished_gaze_movement = gaze_movement_identifier.identify(gaze_position, terminate=(gaze_position.timestamp == ts_gaze_positions[-1])) # Check that last gaze position date is not equal to given gaze position date if finished_gaze_movement: diff --git a/src/argaze.test/GazeFeatures.py b/src/argaze.test/GazeFeatures.py index 2d052ab..11e7c24 100644 --- a/src/argaze.test/GazeFeatures.py +++ b/src/argaze.test/GazeFeatures.py @@ -141,16 +141,16 @@ class TestGazePositionClass(unittest.TestCase): gaze_position_C = GazeFeatures.GazePosition((5, 0), precision=5) gaze_position_D = GazeFeatures.GazePosition((4, 0), precision=5) - self.assertFalse(gaze_position_A.overlap(gaze_position_B)) - self.assertTrue(gaze_position_A.overlap(gaze_position_C)) - self.assertFalse(gaze_position_A.overlap(gaze_position_C, both=True)) + self.assertFalse(gaze_position_A.is_overlapping()(gaze_position_B)) + self.assertTrue(gaze_position_A.is_overlapping()(gaze_position_C)) + self.assertFalse(gaze_position_A.is_overlapping()(gaze_position_C, both=True)) - self.assertFalse(gaze_position_B.overlap(gaze_position_A)) - self.assertTrue(gaze_position_B.overlap(gaze_position_C)) - self.assertFalse(gaze_position_B.overlap(gaze_position_C, both=True)) + self.assertFalse(gaze_position_B.is_overlapping()(gaze_position_A)) + self.assertTrue(gaze_position_B.is_overlapping()(gaze_position_C)) + self.assertFalse(gaze_position_B.is_overlapping()(gaze_position_C, both=True)) - self.assertFalse(gaze_position_C.overlap(gaze_position_A)) - self.assertFalse(gaze_position_C.overlap(gaze_position_B)) + self.assertFalse(gaze_position_C.is_overlapping()(gaze_position_A)) + self.assertFalse(gaze_position_C.is_overlapping()(gaze_position_B)) def test___repr__(self): """Test GazePosition string representation.""" |