From 69bfabce358fe48c0336a278795a740e2410c25e Mon Sep 17 00:00:00 2001 From: appel_c Date: Mon, 8 Dec 2025 16:44:00 +0100 Subject: [PATCH] test(controller): mock config_helper for controller off test --- tests/test_controller.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/test_controller.py b/tests/test_controller.py index 76fdf51..8f29a9e 100644 --- a/tests/test_controller.py +++ b/tests/test_controller.py @@ -11,14 +11,15 @@ def test_controller_off(dm_with_devices): device_manager=dm_with_devices, ) controller.on() - with mock.patch.object(controller.sock, "close") as mock_close: - controller.off() - assert controller.sock is None - assert controller.connected is False - mock_close.assert_called_once() + with mock.patch.object(controller.device_manager, "config_helper") as mock_config_helper: + with mock.patch.object(controller.sock, "close") as mock_close: + controller.off() + assert controller.sock is None + assert controller.connected is False + mock_close.assert_called_once() - # make sure it is indempotent - controller.off() + # make sure it is indempotent + controller.off() controller._reset_controller()