mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2026-02-06 07:08:40 +01:00
test(controller): mock config_helper for controller off test
This commit is contained in:
@@ -11,14 +11,15 @@ def test_controller_off(dm_with_devices):
|
|||||||
device_manager=dm_with_devices,
|
device_manager=dm_with_devices,
|
||||||
)
|
)
|
||||||
controller.on()
|
controller.on()
|
||||||
with mock.patch.object(controller.sock, "close") as mock_close:
|
with mock.patch.object(controller.device_manager, "config_helper") as mock_config_helper:
|
||||||
controller.off()
|
with mock.patch.object(controller.sock, "close") as mock_close:
|
||||||
assert controller.sock is None
|
controller.off()
|
||||||
assert controller.connected is False
|
assert controller.sock is None
|
||||||
mock_close.assert_called_once()
|
assert controller.connected is False
|
||||||
|
mock_close.assert_called_once()
|
||||||
|
|
||||||
# make sure it is indempotent
|
# make sure it is indempotent
|
||||||
controller.off()
|
controller.off()
|
||||||
controller._reset_controller()
|
controller._reset_controller()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user