-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetector_map_tests.py
More file actions
35 lines (19 loc) · 965 Bytes
/
Copy pathdetector_map_tests.py
File metadata and controls
35 lines (19 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pytest
import consumer as ex
import numpy as np
def test_update_index_zero():
detectors = np.zeros((ex.MAX_COLUMN * 2, ex.MAX_ROW)).astype(int)
ex.update_detector(detectors, ex.DETECTOR_ID_OFFSET, 1)
assert detectors[(0, 0)] == 1
def test_update_row_two():
detectors = np.zeros((ex.MAX_COLUMN * 2, ex.MAX_ROW)).astype(int)
ex.update_detector(detectors, ex.MAX_COLUMN + ex.DETECTOR_ID_OFFSET, 1)
assert detectors[(0, 1)] == 1
def test_update_index_zero_panel_two():
detectors = np.zeros((ex.MAX_COLUMN * 2, ex.MAX_ROW)).astype(int)
ex.update_detector(detectors, ex.FIRST_DETECTOR_MAX + ex.DETECTOR_ID_OFFSET, 1)
assert detectors[(ex.MAX_COLUMN, 0)] == 1
def test_update_row_two_panel_two():
detectors = np.zeros((ex.MAX_COLUMN * 2, ex.MAX_ROW)).astype(int)
ex.update_detector(detectors, ex.FIRST_DETECTOR_MAX + ex.MAX_COLUMN + ex.DETECTOR_ID_OFFSET, 1)
assert detectors[(ex.MAX_COLUMN, 1)] == 1