mirror of
https://github.com/waku-org/waku-interop-tests.git
synced 2025-01-18 03:11:24 +00:00
8d956b3d9c
* first set of tests * fix ci * new tests * finish publish tests * new tests * running nodes tests * new tests * finishing touches * new test * temp commit * running node tests * new tests * new store tests * store part 1
31 lines
1.3 KiB
Python
31 lines
1.3 KiB
Python
import pytest
|
|
from src.libs.custom_logger import get_custom_logger
|
|
from src.libs.common import to_base64
|
|
from src.steps.store import StepsStore
|
|
from src.test_data import SAMPLE_INPUTS
|
|
|
|
logger = get_custom_logger(__name__)
|
|
|
|
# TO DO test without pubsubtopic freezes
|
|
|
|
|
|
class TestGetMessages(StepsStore):
|
|
@pytest.fixture(scope="function", autouse=True)
|
|
def store_functional_setup(self, store_setup):
|
|
self.setup_first_publishing_node(store="true", relay="true")
|
|
self.setup_first_store_node(store="true", relay="true")
|
|
self.subscribe_to_pubsub_topics_via_relay()
|
|
|
|
def test_store_messages_with_valid_payloads(self):
|
|
failed_payloads = []
|
|
for payload in SAMPLE_INPUTS:
|
|
logger.debug(f'Running test with payload {payload["description"]}')
|
|
message = self.create_message(payload=to_base64(payload["value"]))
|
|
try:
|
|
self.publish_message_via("relay", message=message)
|
|
self.check_published_message_is_stored(pubsubTopic=self.test_pubsub_topic, pageSize=50, ascending="true")
|
|
except Exception as e:
|
|
logger.error(f'Payload {payload["description"]} failed: {str(e)}')
|
|
failed_payloads.append(payload["description"])
|
|
assert not failed_payloads, f"Payloads failed: {failed_payloads}"
|