logos-messaging-interop-tests/tests/relay/test_multiple_nodes.py

24 lines
1.1 KiB
Python
Raw Normal View History

2023-11-20 16:33:51 +02:00
from time import sleep
2023-11-17 17:58:03 +02:00
import pytest
from src.libs.custom_logger import get_custom_logger
from src.steps.relay import StepsRelay
logger = get_custom_logger(__name__)
2023-11-20 16:33:51 +02:00
@pytest.mark.usefixtures("setup_main_relay_nodes", "setup_optional_relay_nodes", "subscribe_main_relay_nodes")
2023-11-17 17:58:03 +02:00
class TestMultipleNodes(StepsRelay):
2023-11-20 16:33:51 +02:00
def test_first_node_to_start_publishes(self, subscribe_optional_relay_nodes, relay_warm_up):
self.check_published_message_reaches_peer(self.create_message())
2023-11-17 17:58:03 +02:00
2023-11-20 16:33:51 +02:00
def test_last_node_to_start_publishes(self, subscribe_optional_relay_nodes, relay_warm_up):
self.check_published_message_reaches_peer(self.create_message(), sender=self.optional_nodes[-1])
def test_optional_nodes_not_subscribed_to_same_pubsub_topic(self):
self.wait_for_published_message_to_reach_peer(peer_list=self.main_nodes)
try:
self.check_published_message_reaches_peer(self.create_message(), peer_list=self.optional_nodes)
raise AssertionError("Non subscribed nodes received the message!!")
except Exception as ex:
assert "Not Found" in str(ex), "Expected 404 Not Found when the message is not found"