Skip to content

Commit

Permalink
Convert eiger to device_factory
Browse files Browse the repository at this point in the history
  • Loading branch information
rtuck99 committed Jan 13, 2025
1 parent f5b4072 commit 9c0d285
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/mx_bluesky/hyperion/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def plan():

def fake_create_rotation_devices():
beamstop = i03.beamstop(connect_immediately=True, mock=True)
eiger = i03.eiger(fake_with_ophyd_sim=True)
eiger = i03.eiger(connect_immediately=True, mock=True)
smargon = i03.smargon(connect_immediately=True, mock=True)
zebra = i03.zebra(connect_immediately=True, mock=True)
detector_motion = i03.detector_motion(connect_immediately=True, mock=True)
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def done_status():

@pytest.fixture
def eiger(done_status):
eiger = i03.eiger(fake_with_ophyd_sim=True)
eiger = i03.eiger(connect_immediately=True, mock=True)
eiger.stage = MagicMock(return_value=done_status)
eiger.do_arm.set = MagicMock(return_value=done_status)
eiger.unstage = MagicMock(return_value=done_status)
Expand Down Expand Up @@ -811,7 +811,7 @@ async def fake_fgs_composite(
backlight=backlight,
dcm=dcm,
# We don't use the eiger fixture here because .unstage() is used in some tests
eiger=i03.eiger(fake_with_ophyd_sim=True),
eiger=i03.eiger(connect_immediately=True, mock=True),
zebra_fast_grid_scan=i03.zebra_fast_grid_scan(
connect_immediately=True, mock=True
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def test_getting_data_for_ispyb():
tolerances=AperturePosition.tolerances_from_gda_params(params),
)
smargon = i03.smargon(connect_immediately=True, mock=True)
eiger = i03.eiger(fake_with_ophyd_sim=True)
eiger = i03.eiger(mock=True)
await undulator.connect()
slit_gaps.wait_for_connection()
flux.wait_for_connection()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@pytest.fixture
def fake_eiger() -> EigerDetector:
return eiger(fake_with_ophyd_sim=True)
return eiger(mock=True)


def test_read_hardware_for_zocalo_in_RE(fake_eiger, RE: RunEngine):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/common/plan_stubs/test_do_fgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def fgs_devices(RE):
grid_scan_device = ZebraFastGridScan("zebra_fgs")

# Eiger done separately as not ophyd-async yet
detector = eiger(fake_with_ophyd_sim=True)
detector = eiger(mock=True)

return {
"synchrotron": synchrotron,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/hyperion/device_setup_plans/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@pytest.fixture()
def mock_eiger():
eiger = i03.eiger(fake_with_ophyd_sim=True)
eiger = i03.eiger(mock=True)
eiger.detector_params = MagicMock()
eiger.async_stage = MagicMock()
eiger.disarm_detector = MagicMock()
Expand Down

0 comments on commit 9c0d285

Please sign in to comment.