Skip to content
Snippets Groups Projects
Commit 20f61430 authored by Karim Ahmed's avatar Karim Ahmed
Browse files

add tests

parent 62052d63
No related branches found
No related tags found
2 merge requests!901Draft: Tests/add more agipd tests,!900[Jungfrau][DARK] Validate and reorder dark runs before processing
import pytest import pytest
from extra_data import RunDirectory from extra_data import RunDirectory
from cal_tools.jungfraulib import JungfrauCtrl from cal_tools.jungfraulib import JungfrauCtrl, validate_dark_runs
# TODO: replace with mocked RAW data as in tests/test_agipdlib.py # TODO: replace with mocked RAW data as in tests/test_agipdlib.py
JF = JungfrauCtrl( JF = JungfrauCtrl(
...@@ -45,3 +45,22 @@ def test_get_gain_setting(settings, result): ...@@ -45,3 +45,22 @@ def test_get_gain_setting(settings, result):
def test_get_gain_mode(mode, result): def test_get_gain_mode(mode, result):
JF.run_mode = mode JF.run_mode = mode
assert JF.get_gain_mode() == result assert JF.get_gain_mode() == result
@pytest.mark.parametrize(
'original_runs,sorted_runs',
[
([9035, 9036, 9037], [9035, 9036, 9037]),
([9035, 9037, 9036], [9035, 9036, 9037]),
([9033, 9032, 9031], [9031, 9032, 9033]),
([9033, 9031, 9032], [9031, 9032, 9033]),
]
)
# TODO: missing fixed gain dark runs for JUNGFRAU from test proposal.
# TODO: missing fixed and adaptive runs after the JF control updated.
def test_validate_dark_runs(original_runs, sorted_runs):
raw_folder = "/gpfs/exfel/exp/CALLAB/202130/p900203/raw"
validated_runs = validate_dark_runs(
raw_folder=raw_folder,
runs=original_runs,
ctrl_src="FXE_XAD_JF1M/DET/CONTROL")
assert validated_runs == sorted_runs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment