From 50f710dffa58ba4608a4a1f1b2f7d6bb6e5dd854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20Arau=CC=81jo=20Silva?= Date: Thu, 14 Sep 2023 16:33:02 +0200 Subject: [PATCH 1/2] Small improvements --- .../data_sources/kujira/test_kujira_api_data_source.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/hummingbot/connector/gateway/clob_spot/data_sources/kujira/test_kujira_api_data_source.py b/test/hummingbot/connector/gateway/clob_spot/data_sources/kujira/test_kujira_api_data_source.py index 7e0a2acd15..de780f85e1 100644 --- a/test/hummingbot/connector/gateway/clob_spot/data_sources/kujira/test_kujira_api_data_source.py +++ b/test/hummingbot/connector/gateway/clob_spot/data_sources/kujira/test_kujira_api_data_source.py @@ -32,10 +32,10 @@ ) from hummingbot.core.network_iterator import NetworkStatus -module_3 = importlib.import_module("hummingbot.connector.gateway.clob_spot.data_sources.kujira.kujira_constants") -module_3.NUMBER_OF_RETRIES = 0 -module_3.DELAY_BETWEEN_RETRIES = 0 -module_3.TIMEOUT = None +kujira_constants_module = importlib.import_module("hummingbot.connector.gateway.clob_spot.data_sources.kujira.kujira_constants") +kujira_constants_module.NUMBER_OF_RETRIES = 0 +kujira_constants_module.DELAY_BETWEEN_RETRIES = 0 +kujira_constants_module.TIMEOUT = None from hummingbot.connector.gateway.clob_spot.data_sources.kujira.kujira_api_data_source import ( # noqa: E402 KujiraAPIDataSource, From 21451143280f8dc27cc4bd7b705b623d7770cd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20Arau=CC=81jo=20Silva?= Date: Thu, 14 Sep 2023 17:10:41 +0200 Subject: [PATCH 2/2] Improving tests. --- .../kujira/test_kujira_api_data_source.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/hummingbot/connector/gateway/clob_spot/data_sources/kujira/test_kujira_api_data_source.py b/test/hummingbot/connector/gateway/clob_spot/data_sources/kujira/test_kujira_api_data_source.py index de780f85e1..7533030b80 100644 --- a/test/hummingbot/connector/gateway/clob_spot/data_sources/kujira/test_kujira_api_data_source.py +++ b/test/hummingbot/connector/gateway/clob_spot/data_sources/kujira/test_kujira_api_data_source.py @@ -32,10 +32,21 @@ ) from hummingbot.core.network_iterator import NetworkStatus -kujira_constants_module = importlib.import_module("hummingbot.connector.gateway.clob_spot.data_sources.kujira.kujira_constants") -kujira_constants_module.NUMBER_OF_RETRIES = 0 -kujira_constants_module.DELAY_BETWEEN_RETRIES = 0 -kujira_constants_module.TIMEOUT = None + +def mock_automatic_retry_with_timeout(retries=0, delay=0, timeout=None): + def decorator(func): + return func + + return decorator + + +kujira_helpers_module = importlib.import_module("hummingbot.connector.gateway.clob_spot.data_sources.kujira.kujira_helpers") +kujira_helpers_module.automatic_retry_with_timeout = mock_automatic_retry_with_timeout + +# kujira_constants_module = importlib.import_module("hummingbot.connector.gateway.clob_spot.data_sources.kujira.kujira_constants") +# kujira_constants_module.NUMBER_OF_RETRIES = 0 +# kujira_constants_module.DELAY_BETWEEN_RETRIES = 0 +# kujira_constants_module.TIMEOUT = None from hummingbot.connector.gateway.clob_spot.data_sources.kujira.kujira_api_data_source import ( # noqa: E402 KujiraAPIDataSource,