aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-05-31 11:36:04 +0200
committerThéo de la Hogue2023-05-31 11:36:04 +0200
commit5ff3aacbea7507f74d0d2217fdc9aaa5a2bee6b0 (patch)
treeae56cc6c8c2579822f24c2d6f6a62d01e0c2f59c
parent4a83037c3cd1d98cf16f98efd26e7e2a8d356b25 (diff)
downloadargaze-5ff3aacbea7507f74d0d2217fdc9aaa5a2bee6b0.zip
argaze-5ff3aacbea7507f74d0d2217fdc9aaa5a2bee6b0.tar.gz
argaze-5ff3aacbea7507f74d0d2217fdc9aaa5a2bee6b0.tar.bz2
argaze-5ff3aacbea7507f74d0d2217fdc9aaa5a2bee6b0.tar.xz
Adding a building_scan_path function for testing purpose.
-rw-r--r--src/argaze.test/GazeFeatures.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/argaze.test/GazeFeatures.py b/src/argaze.test/GazeFeatures.py
index 4681dbc..8206baf 100644
--- a/src/argaze.test/GazeFeatures.py
+++ b/src/argaze.test/GazeFeatures.py
@@ -232,6 +232,23 @@ class TestScanStepClass(unittest.TestCase):
self.assertEqual(scan_step.last_saccade, saccade)
self.assertGreater(scan_step.duration, 0)
+def build_scan_path(size):
+ """Build scan path"""
+
+ scan_path = GazeFeatures.ScanPath()
+
+ for i in range(size):
+
+ fixation = GazeFeatures.Fixation(random_gaze_positions(10))
+ ts, _ = fixation.positions.first
+ scan_path.append_fixation(ts, fixation)
+
+ saccade = GazeFeatures.Saccade(random_gaze_positions(2))
+ ts, _ = saccade.positions.first
+ scan_path.append_saccade(ts, saccade)
+
+ return scan_path
+
class TestScanPathClass(unittest.TestCase):
"""Test ScanPath class."""
@@ -352,7 +369,7 @@ class TestAOIScanStepClass(unittest.TestCase):
aoi_scan_step = GazeFeatures.AOIScanStep(movements, 'Test')
def build_aoi_scan_path(expected_aois, aoi_path):
- """Build AOI Scan path"""
+ """Build AOI scan path"""
aoi_scan_path = GazeFeatures.AOIScanPath(expected_aois)