aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/GazeFeatures.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/argaze.test/GazeFeatures.py')
-rw-r--r--src/argaze.test/GazeFeatures.py78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/argaze.test/GazeFeatures.py b/src/argaze.test/GazeFeatures.py
index aebbcfc..4679929 100644
--- a/src/argaze.test/GazeFeatures.py
+++ b/src/argaze.test/GazeFeatures.py
@@ -209,11 +209,11 @@ 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 TestVisualScanStepClass(unittest.TestCase):
- """Test VisualScanStep class."""
+class TestAOIScanStepClass(unittest.TestCase):
+ """Test AOIScanStep class."""
def test_new(self):
- """Test VisualScanStep creation."""
+ """Test AOIScanStep creation."""
movements = GazeFeatures.TimeStampedGazeMovements()
@@ -225,17 +225,17 @@ class TestVisualScanStepClass(unittest.TestCase):
ts, _ = saccade.positions.first
movements[ts] = saccade
- visual_scan_step = GazeFeatures.VisualScanStep(movements, 'Test')
+ aoi_scan_step = GazeFeatures.AOIScanStep(movements, 'Test')
- # Check visual scan step creation
- self.assertEqual(len(visual_scan_step.movements), 2)
- self.assertEqual(visual_scan_step.aoi, 'Test')
- self.assertEqual(visual_scan_step.first_fixation, fixation)
- self.assertEqual(visual_scan_step.last_saccade, saccade)
- self.assertGreater(visual_scan_step.duration, 0)
+ # Check aoi scan step creation
+ self.assertEqual(len(aoi_scan_step.movements), 2)
+ self.assertEqual(aoi_scan_step.aoi, 'Test')
+ self.assertEqual(aoi_scan_step.first_fixation, fixation)
+ self.assertEqual(aoi_scan_step.last_saccade, saccade)
+ self.assertGreater(aoi_scan_step.duration, 0)
def test_error(self):
- """Test VisualScanStep creation error."""
+ """Test AOIScanStep creation error."""
movements = GazeFeatures.TimeStampedGazeMovements()
@@ -247,81 +247,81 @@ class TestVisualScanStepClass(unittest.TestCase):
ts, _ = fixation.positions.first
movements[ts] = fixation
- # Check that visual scan step creation fail
- with self.assertRaises(GazeFeatures.VisualScanStepError):
+ # Check that aoi scan step creation fail
+ with self.assertRaises(GazeFeatures.AOIScanStepError):
- visual_scan_step = GazeFeatures.VisualScanStep(movements, 'Test')
+ aoi_scan_step = GazeFeatures.AOIScanStep(movements, 'Test')
-class TestVisualScanPathClass(unittest.TestCase):
- """Test VisualScanPath class."""
+class TestAOIScanPathClass(unittest.TestCase):
+ """Test AOIScanPath class."""
def test_new(self):
- """Test VisualScanPath creation."""
+ """Test AOIScanPath creation."""
- # Check visual scan step creation
- visual_scan_path = GazeFeatures.VisualScanPath()
+ # Check aoi scan step creation
+ aoi_scan_path = GazeFeatures.AOIScanPath()
- self.assertEqual(len(visual_scan_path), 0)
+ self.assertEqual(len(aoi_scan_path), 0)
def test_append(self):
- """Test VisualScanPath append methods."""
+ """Test AOIScanPath append methods."""
- visual_scan_path = GazeFeatures.VisualScanPath()
+ aoi_scan_path = GazeFeatures.AOIScanPath()
# Append fixation on A aoi
fixation = GazeFeatures.Fixation(random_gaze_positions(10))
ts, _ = fixation.positions.first
- new_step = visual_scan_path.append_fixation(ts, fixation, 'A')
+ new_step = aoi_scan_path.append_fixation(ts, fixation, 'A')
- # Check that no visual scan step have been created yet
- self.assertEqual(len(visual_scan_path), 0)
+ # Check that no aoi scan step have been created yet
+ self.assertEqual(len(aoi_scan_path), 0)
self.assertEqual(new_step, None)
# Append saccade
saccade = GazeFeatures.Saccade(random_gaze_positions(2))
ts, _ = saccade.positions.first
- new_step = visual_scan_path.append_saccade(ts, saccade)
+ new_step = aoi_scan_path.append_saccade(ts, saccade)
- # Check that no visual scan step have been created yet
- self.assertEqual(len(visual_scan_path), 0)
+ # Check that no aoi scan step have been created yet
+ self.assertEqual(len(aoi_scan_path), 0)
self.assertEqual(new_step, None)
# Append fixation on B aoi
fixation = GazeFeatures.Fixation(random_gaze_positions(10))
ts, _ = fixation.positions.first
- new_step = visual_scan_path.append_fixation(ts, fixation, 'B')
+ new_step = aoi_scan_path.append_fixation(ts, fixation, 'B')
- # Check a new visual scan step have been created
- self.assertEqual(len(visual_scan_path), 1)
+ # Check a new aoi scan step have been created
+ self.assertEqual(len(aoi_scan_path), 1)
self.assertEqual(len(new_step.movements), 2)
self.assertEqual(new_step.aoi, 'A')
def test_append_error(self):
- """Test VisualScanPath append error."""
+ """Test AOIScanPath append error."""
- visual_scan_path = GazeFeatures.VisualScanPath()
+ aoi_scan_path = GazeFeatures.AOIScanPath()
# Append fixation on A aoi
fixation = GazeFeatures.Fixation(random_gaze_positions(10))
ts, _ = fixation.positions.first
- new_step = visual_scan_path.append_fixation(ts, fixation, 'A')
+ new_step = aoi_scan_path.append_fixation(ts, fixation, 'A')
- # Check that no visual scan step have been created yet
- self.assertEqual(len(visual_scan_path), 0)
+ # Check that no aoi scan step have been created yet
+ self.assertEqual(len(aoi_scan_path), 0)
self.assertEqual(new_step, None)
# Append fixation on B aoi
fixation = GazeFeatures.Fixation(random_gaze_positions(10))
ts, _ = fixation.positions.first
- # Check that visual scan step creation fail
- with self.assertRaises(GazeFeatures.VisualScanStepError):
+ # Check that aoi scan step creation fail
+ with self.assertRaises(GazeFeatures.AOIScanStepError):
- new_step = visual_scan_path.append_fixation(ts, fixation, 'B')
+ new_step = aoi_scan_path.append_fixation(ts, fixation, 'B')
if __name__ == '__main__':