From 46898394778bdcf477dc5592949cd580fb9149b4 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 23 Sep 2024 15:41:13 +0000 Subject: [PATCH] outlined the tests to fix --- tests/beamlines/unit_tests/test_p38.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/beamlines/unit_tests/test_p38.py b/tests/beamlines/unit_tests/test_p38.py index 71d2b43773..afca137eb0 100644 --- a/tests/beamlines/unit_tests/test_p38.py +++ b/tests/beamlines/unit_tests/test_p38.py @@ -1,5 +1,7 @@ import os +import pytest + from dodal.common.beamlines import beamline_utils from dodal.devices.i22.nxsas import NXSasOAV @@ -11,3 +13,20 @@ def test_devices_diff_when_in_lab(): beamline_utils.clear_devices() saxs = i22.saxs(wait_for_connection=False, fake_with_ophyd_sim=True) assert saxs.__class__ == NXSasOAV, f"Expected NXSasOav, got {saxs.__class__}" + + +# todo fix the following tests +# FAILED tests/beamlines/unit_tests/test_i03.py::test_list - KeyError: "No beamline parameter path found, maybe 'BEAMLINE' environment variable is not set!" +# FAILED tests/beamlines/unit_tests/test_p38.py::test_devices_diff_when_in_lab - AssertionError: Expected NXSasOav, got +# assert == NXSasOAV +# + where = .__class__ + + +@pytest.mark.parametrize("module_and_devices_for_beamline", ["p38"], indirect=True) +def test_device_creation(RE, module_and_devices_for_beamline): + _, devices = module_and_devices_for_beamline + saxs: NXSasOAV = devices["saxs"] # type: ignore + + print(saxs) + assert saxs.prefix == "BL24I-MO-VGON-01:" + assert saxs.kappa.prefix == "BL24I-MO-VGON-01:KAPPA"