diff options
author | Théo de la Hogue | 2023-07-06 15:50:31 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-07-06 15:50:31 +0200 |
commit | 717452611747ab98a5e94c1f90afcc2854923c68 (patch) | |
tree | 9e03e7d6ede09b1436a9b25957b2def4ae8ed946 /src/argaze.test/GazeFeatures.py | |
parent | ce43c0e9f100aa0eaec2f39a258e92ffc5cc44a8 (diff) | |
download | argaze-717452611747ab98a5e94c1f90afcc2854923c68.zip argaze-717452611747ab98a5e94c1f90afcc2854923c68.tar.gz argaze-717452611747ab98a5e94c1f90afcc2854923c68.tar.bz2 argaze-717452611747ab98a5e94c1f90afcc2854923c68.tar.xz |
Adding and testing finished attribute to GazeMovement class.
Diffstat (limited to 'src/argaze.test/GazeFeatures.py')
-rw-r--r-- | src/argaze.test/GazeFeatures.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/argaze.test/GazeFeatures.py b/src/argaze.test/GazeFeatures.py index dd3f1c0..b8d173c 100644 --- a/src/argaze.test/GazeFeatures.py +++ b/src/argaze.test/GazeFeatures.py @@ -287,6 +287,37 @@ class TestTimeStampedGazePositionsClass(unittest.TestCase): self.assertEqual(ts_gaze_positions_dataframe["value"].dtype, 'object') self.assertEqual(ts_gaze_positions_dataframe["precision"].dtype, 'O') # Python object type +class TestGazeMovementClass(unittest.TestCase): + """Test GazeMovement class.""" + + def test_new(self): + """Test GazeMovement creation.""" + + abstract_gaze_movement = GazeFeatures.GazeMovement(random_gaze_positions(0)) + + # Check abstract GazeMovement + self.assertEqual(len(abstract_gaze_movement.positions), 0) + self.assertEqual(abstract_gaze_movement.duration, -1) + self.assertEqual(abstract_gaze_movement.amplitude, -1) + self.assertEqual(abstract_gaze_movement.valid, False) + self.assertEqual(abstract_gaze_movement.finished, False) + +class TestUnvalidGazeMovementClass(unittest.TestCase): + """Test UnvalidGazeMovement class.""" + + def test_new(self): + """Test UnvalidGazeMovement creation.""" + + unvalid_gaze_movement = GazeFeatures.UnvalidGazeMovement('test') + + # Check UnvalidGazeMovement + self.assertEqual(len(unvalid_gaze_movement.positions), 0) + self.assertEqual(unvalid_gaze_movement.duration, -1) + self.assertEqual(unvalid_gaze_movement.amplitude, -1) + self.assertEqual(unvalid_gaze_movement.valid, False) + self.assertEqual(unvalid_gaze_movement.finished, False) + self.assertEqual(unvalid_gaze_movement.message, 'test') + class TestScanStepClass(unittest.TestCase): """Test ScanStep class.""" |