From 3d66f3e2d58b7038cdfdf272f2d813e24b730243 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Mon, 3 Jul 2023 14:53:40 +0200 Subject: Updating GazeAnalysis test. --- src/argaze.test/GazeAnalysis/NearestNeighborIndex.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/argaze.test/GazeAnalysis/NearestNeighborIndex.py') diff --git a/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py b/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py index fb7d4ec..abd6b2c 100644 --- a/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py +++ b/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py @@ -21,19 +21,20 @@ class TestScanPathAnalyzer(unittest.TestCase): def test_analyze(self): """Test analyze.""" - nni_analyzer = NearestNeighborIndex.ScanPathAnalyzer() - screen_dimension = (100, 100) + + nni_analyzer = NearestNeighborIndex.ScanPathAnalyzer(size=screen_dimension) + scan_path = GazeFeaturesTest.build_scan_path(6, screen_dimension) # Check aoi scan path self.assertEqual(len(scan_path), 6) - nni = nni_analyzer.analyze(scan_path, screen_dimension) + nni_analyzer.analyze(scan_path) # Check NNI - self.assertGreaterEqual(nni, 0) - self.assertLessEqual(nni, 1) + self.assertGreaterEqual(nni_analyzer.nearest_neighbor_index, 0) + self.assertLessEqual(nni_analyzer.nearest_neighbor_index, 1) if __name__ == '__main__': -- cgit v1.1