2023-11-21 07:29:48 +00:00
|
|
|
import pytest
|
|
|
|
from src.steps.relay import StepsRelay
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.usefixtures("setup_main_relay_nodes", "setup_optional_relay_nodes", "subscribe_main_relay_nodes")
|
2023-12-27 14:03:31 +00:00
|
|
|
class TestRelayMultipleNodes(StepsRelay):
|
2023-11-21 07:29:48 +00:00
|
|
|
def test_first_node_to_start_publishes(self, subscribe_optional_relay_nodes, relay_warm_up):
|
2023-12-11 12:02:50 +00:00
|
|
|
self.check_published_message_reaches_relay_peer()
|
2023-11-21 07:29:48 +00:00
|
|
|
|
|
|
|
def test_last_node_to_start_publishes(self, subscribe_optional_relay_nodes, relay_warm_up):
|
2023-12-11 12:02:50 +00:00
|
|
|
self.check_published_message_reaches_relay_peer(sender=self.optional_nodes[-1])
|
2023-11-21 07:29:48 +00:00
|
|
|
|
|
|
|
def test_optional_nodes_not_subscribed_to_same_pubsub_topic(self):
|
2023-12-11 12:02:50 +00:00
|
|
|
self.wait_for_published_message_to_reach_relay_peer(peer_list=self.main_nodes)
|
2023-11-21 07:29:48 +00:00
|
|
|
try:
|
2023-12-11 12:02:50 +00:00
|
|
|
self.check_published_message_reaches_relay_peer(peer_list=self.optional_nodes)
|
2023-11-21 07:29:48 +00:00
|
|
|
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"
|