aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/GazeAnalysis/NearestNeighborIndex.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/argaze.test/GazeAnalysis/NearestNeighborIndex.py')
-rw-r--r--src/argaze.test/GazeAnalysis/NearestNeighborIndex.py11
1 files changed, 6 insertions, 5 deletions
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__':