From 89384d778344ecd70cf2a7c25396dfe9ba61ea3f Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Tue, 19 Aug 2025 16:42:48 -0300 Subject: [PATCH] SIENTIAPDE-1199 Update test for validate_connection method in OpcRepository to include detailed response structure - Modified the test case to assert the response format when the connection is lost, ensuring it includes notification ID, message, block, and level attributes for better clarity in error handling. --- tests/laborious/utils/repository/test_opc_repository.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/laborious/utils/repository/test_opc_repository.py b/tests/laborious/utils/repository/test_opc_repository.py index f80cf40..768458e 100644 --- a/tests/laborious/utils/repository/test_opc_repository.py +++ b/tests/laborious/utils/repository/test_opc_repository.py @@ -182,7 +182,12 @@ def test_validate_connection_lost_not_time_to_reconect(_mock_datetime, opc_repos response = opc_repository.validate_connection() opc_repository.try_connect.assert_not_called() - assert response == (False, {}) + assert response == (False, { + "notification_id": f"OPC_CONNECTION_AWAITING_RECONNECTION_WINDOW_{opc_repository.id}", + "message": f"OPC server {opc_repository.id} is not connected, waiting for next reconnection window...", + "block": "opc_repository", + "level": NotificationLevel.WARNING + }) @patch('laborious.utils.repository.opc_repository.hasattr', return_value=True)