diff --git a/tests/test_gotthard2lib.py b/tests/test_gotthard2lib.py index a47eebd4dd3d801c3875bb07a304b05ca59a7751..713ddaa6e1c3a5d6509b6ef9cc541e010c164a0f 100644 --- a/tests/test_gotthard2lib.py +++ b/tests/test_gotthard2lib.py @@ -2,26 +2,25 @@ import pytest from cal_tools.gotthard2.gotthard2lib import sort_dark_runs_by_gain +# TODO: Uncomment when test proposal have GH2 dark runs. +# xcaltst has no permission to access other than CALLAB RAW data. +# @pytest.mark.requires_gpfs +# def test_sort_dark_runs_by_gain(): +# raw_folder = "/gpfs/exfel/exp/FXE/202231/p900298/raw" +# ctrl_src = "FXE_XAD_G2XES/DET/CONTROL" +# runs = [9, 8, 7] +# sorted_runs = sort_dark_runs_by_gain(raw_folder, runs, ctrl_src) +# assert sorted_runs == [7, 8, 9] -@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/FXE/202231/p900298/raw" - ctrl_src = "FXE_XAD_G2XES/DET/CONTROL" - runs = [9, 8, 7] - sorted_runs = sort_dark_runs_by_gain(raw_folder, runs, ctrl_src) - assert sorted_runs == [7, 8, 9] +# @pytest.mark.requires_gpfs +# def test_raise_sort_dark_runs_by_gain(): +# raw_folder = "/gpfs/exfel/exp/SA1/202331/p900384/raw" +# ctrl_src = "SA1_XTD9_HIREX/DET/GOTTHARD2_CTRL" +# runs = [60, 61, 62, 63] +# with pytest.raises(AssertionError): # More than 3 runs +# sort_dark_runs_by_gain(raw_folder, runs, ctrl_src) -@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/SA1/202331/p900384/raw" - ctrl_src = "SA1_XTD9_HIREX/DET/GOTTHARD2_CTRL" - runs = [60, 61, 62, 63] - with pytest.raises(AssertionError) as err: - sort_dark_runs_by_gain(raw_folder, runs, ctrl_src) - - runs = [89, 61, 63] # dynamicgain, dynamicgain, fixgain2 - with pytest.raises(ValueError) as err: - sort_dark_runs_by_gain(raw_folder, runs, ctrl_src) \ No newline at end of file +# runs = [89, 61, 63] # dynamicgain, dynamicgain, fixgain2 +# with pytest.raises(ValueError): # Two high gain runs +# sort_dark_runs_by_gain(raw_folder, runs, ctrl_src)