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

This commit is contained in:
2026-01-22 08:50:13 +01:00
parent ae20de9391
commit 5c5a5c3d98
+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