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

add tests

parent a8e4eef9
No related branches found
No related tags found
1 merge request!960[LPD][Dark ] Sort Dark runs by Gain
import pytest
from cal_tools.lpdlib import sort_dark_runs_by_gain
@pytest.mark.requires_gpfs
def test_sort_dark_runs_by_gain():
# TODO: update used raw data to test data when available.
raw_folder = "/gpfs/exfel/exp/CALLAB/202130/p900203/raw"
ctrl_src = "FXE_DET_LPD1M-1/COMP/FEM_MDL_COMP"
runs = [9008, 9010, 9009]
sorted_runs = sort_dark_runs_by_gain(raw_folder, runs, ctrl_src)
assert sorted_runs == [9008, 9009, 9010]
@pytest.mark.requires_gpfs
def test_raise_sort_dark_runs_by_gain():
# TODO: update used raw data to test data when available.
raw_folder = "/gpfs/exfel/exp/CALLAB/202130/p900203/raw"
ctrl_src = "FXE_DET_LPD1M-1/COMP/FEM_MDL_COMP"
runs = [9008, 9009]
with pytest.raises(AssertionError) as err:
sort_dark_runs_by_gain(raw_folder, runs, ctrl_src)
runs = [9008, 9008, 9009] # dynamicgain, dynamicgain, fixgain2
with pytest.raises(ValueError) as err:
sort_dark_runs_by_gain(raw_folder, runs, ctrl_src)
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