test: add test for controller to call destroy controller.off
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user