mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-12-19 11:01:18 +01:00
added tests
This commit is contained in:
26
python/tests/test_pythonAPI.py
Normal file
26
python/tests/test_pythonAPI.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import pytest
|
||||
|
||||
from slsdet import Detector
|
||||
|
||||
def test_rx_ROI():
|
||||
""" Test setting and getting rx_ROI property of Detector class. """
|
||||
|
||||
d = Detector()
|
||||
d.rx_roi = (0, 10, 10, 20)
|
||||
roi = d.rx_roi
|
||||
assert roi == [(0, 10, 10, 20)]
|
||||
|
||||
d.rx_roi = [5,15,15,25]
|
||||
|
||||
assert d.rx_roi == [(5,15,15,25)]
|
||||
|
||||
d.rx_roi = [[0,10,0,20], [5,20,410,420]] #needs to be in second module
|
||||
|
||||
roi = d.rx_roi
|
||||
assert roi == [(0,10,0,20), (5,20,410,420)]
|
||||
|
||||
d.clear_rx_roi()
|
||||
roi = d.rx_roi
|
||||
assert roi == [(-1,-1,-1,-1)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user