Skip to content
Snippets Groups Projects
Commit 9847e518 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Add tests for .select_modules() method

parent 4229e8a0
No related branches found
No related tags found
1 merge request!885Revised CalCat API
......@@ -72,6 +72,22 @@ def test_DSSC_modules_missing():
assert dssc_cd.module_nums == modnos
assert dssc_cd.qm_names == [f"Q{(m // 4) + 1}M{(m % 4) + 1}" for m in modnos]
offset = dssc_cd["Offset"]
assert offset.module_nums == modnos
# test ModulesConstantVersions.select_modules()
modnos_q3 = list(range(8, 12))
aggs_q3 = [f"DSSC{m:02}" for m in modnos_q3]
qm_q3 = [f"Q3M{i}" for i in range(1, 5)]
assert offset.select_modules(modnos_q3).module_nums == modnos_q3
assert offset.select_modules(aggregators=aggs_q3).module_nums == modnos_q3
assert offset.select_modules(qm_names=qm_q3).module_nums == modnos_q3
# test CalibrationData.select_modules()
assert dssc_cd.select_modules(modnos_q3).module_nums == modnos_q3
assert dssc_cd.select_modules(aggregators=aggs_q3).module_nums == modnos_q3
assert dssc_cd.select_modules(qm_names=qm_q3).module_nums == modnos_q3
@pytest.mark.requires_gpfs
def test_LPD_constant_missing():
......
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