diff --git a/tests/wrappers_tests/conftest.py b/tests/wrappers_tests/conftest.py index e05fb6989..7e96b6d80 100644 --- a/tests/wrappers_tests/conftest.py +++ b/tests/wrappers_tests/conftest.py @@ -12,15 +12,14 @@ def _free_port(): def build_node_config(**overrides): config = { "logLevel": "DEBUG", - "mode": "Core", "listenAddress": "0.0.0.0", "tcpPort": _free_port(), - "udpPort": _free_port(), + "discv5UdpPort": _free_port(), "restPort": _free_port(), "restAddress": "0.0.0.0", "clusterId": DEFAULT_CLUSTER_ID, - "relay": False, - "store": False, + "relay": True, + "store": True, "filter": False, "lightpush": False, "peerExchange": False, diff --git a/tests/wrappers_tests/test_basic_life_cycle.py b/tests/wrappers_tests/test_basic_life_cycle.py index c66fe7580..49f10c1a6 100644 --- a/tests/wrappers_tests/test_basic_life_cycle.py +++ b/tests/wrappers_tests/test_basic_life_cycle.py @@ -4,32 +4,23 @@ from src.node.wrappers_manager import WrapperManager @pytest.mark.smoke class TestLogosDeliveryLifecycle: - def test_create_and_start_node(self, node_config): + def _create_started_node(self, node_config): result = WrapperManager.create_and_start(config=node_config) assert result.is_ok(), f"Failed to create and start node: {result.err()}" - node = result.ok_value + return result.ok_value - stop_result = node.stop_and_destroy() - assert stop_result.is_ok(), f"Failed to stop and destroy node: {stop_result.err()}" - - def test_create_node_without_starting(self, node_config): - result = WrapperManager.create(config=node_config) - assert result.is_ok(), f"Failed to create node: {result.err()}" - node = result.ok_value - - start_result = node.start_node() - assert start_result.is_ok(), f"Failed to start node: {start_result.err()}" + def test_create_and_start_node(self, node_config): + node = self._create_started_node(node_config) stop_result = node.stop_and_destroy() assert stop_result.is_ok(), f"Failed to stop and destroy node: {stop_result.err()}" def test_stop_node_without_destroy(self, node_config): - result = WrapperManager.create_and_start(config=node_config) - assert result.is_ok(), f"Failed to create and start node: {result.err()}" - node = result.ok_value + node = self._create_started_node(node_config) - stop_result = node.stop_node() - assert stop_result.is_ok(), f"Failed to stop node: {stop_result.err()}" - - destroy_result = node.destroy() - assert destroy_result.is_ok(), f"Failed to destroy node: {destroy_result.err()}" + try: + stop_result = node.stop_node() + assert stop_result.is_ok(), f"Failed to stop node: {stop_result.err()}" + finally: + destroy_result = node.destroy() + assert destroy_result.is_ok(), f"Failed to destroy node: {destroy_result.err()}"