From 5ff3aacbea7507f74d0d2217fdc9aaa5a2bee6b0 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 31 May 2023 11:36:04 +0200 Subject: Adding a building_scan_path function for testing purpose. --- src/argaze.test/GazeFeatures.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/argaze.test/GazeFeatures.py') 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) -- cgit v1.1