From 91e9a86a300a090e683b75468cfac725c8bf41be Mon Sep 17 00:00:00 2001 From: shashankshampi Date: Sat, 2 Nov 2024 20:30:18 +0530 Subject: [PATCH] test_: Code Migration from status-cli-tests logger removal --- tests-functional/clients/signals.py | 5 ++--- tests-functional/tests/test_contact_request.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests-functional/clients/signals.py b/tests-functional/clients/signals.py index 765d1c1a0..af6bf2c55 100644 --- a/tests-functional/clients/signals.py +++ b/tests-functional/clients/signals.py @@ -1,5 +1,4 @@ import json -import logging import time from src.libs.common import write_signal_to_file @@ -33,7 +32,7 @@ class SignalClient: raise TimeoutError( f"Signal {signal_type} is not received in {timeout} seconds") time.sleep(0.2) - logging.debug(f"Signal {signal_type} is received in {round(time.time() - start_time)} seconds") + logger.debug(f"Signal {signal_type} is received in {round(time.time() - start_time)} seconds") return self.received_signals[signal_type][0] def wait_for_complete_signal(self, signal_type, timeout=5): @@ -47,7 +46,7 @@ class SignalClient: time.sleep(0.2) if events: - logging.debug( + logger.debug( f"Collected {len(events)} events of type {signal_type} within {timeout} seconds") return events raise TimeoutError(f"No signals of type {signal_type} received in {timeout} seconds") diff --git a/tests-functional/tests/test_contact_request.py b/tests-functional/tests/test_contact_request.py index e2ed170dc..482dc3f20 100644 --- a/tests-functional/tests/test_contact_request.py +++ b/tests-functional/tests/test_contact_request.py @@ -1,4 +1,3 @@ -import logging from uuid import uuid4 from constants import * from src.libs.common import delay @@ -10,6 +9,7 @@ from validators.contact_request_validator import ContactRequestValidator logger = get_custom_logger(__name__) + class TestContactRequest(StepsCommon): def test_contact_request_baseline(self): timeout_secs = 3 @@ -112,7 +112,7 @@ class TestContactRequest(StepsCommon): ) break except AssertionError as validation_error: - logging.error(f"Validation failed for event: {messages_new_event}, Error: {validation_error}") + logger.error(f"Validation failed for event: {messages_new_event}, Error: {validation_error}") continue if messages_new_event is None: @@ -120,7 +120,7 @@ class TestContactRequest(StepsCommon): first_node.wait_for_signal("history.request.completed", timeout) except (TimeoutError, ValueError) as e: - logging.error(f"Signal validation failed: {str(e)}") + logger.error(f"Signal validation failed: {str(e)}") return timestamp, message_id, contact_request_message, None first_node.stop()