test: add test for controller to call destroy controller.off
CI for csaxs_bec / test (push) Successful in 1m32s

This commit was merged in pull request #130.
This commit is contained in:
2026-01-26 07:45:01 +01:00
parent 628e31da60
commit 153e6a89a4
+9
View File
@@ -207,6 +207,15 @@ def test_wait_for_connection_called():
motor.wait_for_connection(timeout=5.0)
assert mock_on.call_args_list[-1] == mock.call(timeout=5.0)
# Make sure destroy calls controller off
with mock.patch.object(motor.controller, "off") as mock_off:
motor.destroy()
assert mock_off.call_count == 1
assert mock_off.call_args_list[0] == mock.call(update_config=False)
assert motor._destroyed is True
finally:
controller_cls._reset_controller()
controller_cls._axes_per_controller = ctrl_axis_backup