diff --git a/tests/test_calcat_interface2.py b/tests/test_calcat_interface2.py index 5b3e82b3a7f38792de97130530c71a22e12b1298..36b42b9d873e6f53d31f7395e5916d66605e63c2 100644 --- a/tests/test_calcat_interface2.py +++ b/tests/test_calcat_interface2.py @@ -4,6 +4,7 @@ from cal_tools.calcat_interface2 import ( CalibrationData, AGIPDConditions, DSSCConditions, + LPDConditions, SingleConstantVersion, ) @@ -67,11 +68,27 @@ def test_DSSC_modules_missing(): ) # DSSC was used with only 3 quadrants at this point modnos = list(range(4)) + list(range(8, 16)) - assert dssc_cd.aggregator_names == [f'DSSC{m:02}' for m in modnos] + assert dssc_cd.aggregator_names == [f"DSSC{m:02}" for m in modnos] assert dssc_cd.module_nums == modnos - assert dssc_cd.qm_names == [ - f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos - ] + assert dssc_cd.qm_names == [f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos] + + +@pytest.mark.requires_gpfs +def test_LPD_constant_missing(): + lpd_cd = CalibrationData.from_condition( + LPDConditions(memory_cells=200, sensor_bias_voltage=250), + "FXE_DET_LPD1M-1", + event_at="2022-05-22T02:00:00", + ) + # Constants are missing for 1 module (LPD05), but it was still included in + # the PDUs for the detector, so it should still appear in the lists. + modnos = range(16) + assert lpd_cd.aggregator_names == [f"DSSC{m:02}" for m in modnos] + assert lpd_cd.module_nums == modnos + assert lpd_cd.qm_names == [f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos] + + assert len(lpd_cd["Offset"].module_nums) == 16 + assert len(lpd_cd["Offset"].constants) == 15 @pytest.mark.xfail