waku-interop-tests/tests/store/test_ephemeral.py
fbarbu15 03973b8897
Test/store v3 (#38)
* first commit

* get message tests 1

* store tests with node restarts

* reliability tests

* store tests

* fixes

* more tests

* fixes

* new store tests

* new store tests

* adjustments

* adjust tests for go-waku

* postgress test

* postgress test

* fixes

* small fixes

* reliability updates

* postgress test

* adjsutmens for go-waku
2024-05-28 16:50:14 +03:00

27 lines
1.3 KiB
Python

import pytest
from src.libs.custom_logger import get_custom_logger
from src.steps.store import StepsStore
logger = get_custom_logger(__name__)
@pytest.mark.usefixtures("node_setup")
class TestEphemeral(StepsStore):
def test_message_with_ephemeral_true(self):
self.publish_message(message=self.create_message(ephemeral=True))
self.check_store_returns_empty_response()
def test_message_with_ephemeral_false(self):
self.publish_message(message=self.create_message(ephemeral=False))
self.check_published_message_is_stored(page_size=5, ascending="true")
def test_message_with_both_ephemeral_true_and_false(self):
self.publish_message(message=self.create_message(ephemeral=True))
stored = self.publish_message(message=self.create_message(ephemeral=False))
self.check_published_message_is_stored(page_size=5, ascending="true", message_to_check=stored)
assert len(self.store_response.messages) == 1
stored = self.publish_message(message=self.create_message(ephemeral=False))
self.publish_message(message=self.create_message(ephemeral=True))
self.check_published_message_is_stored(page_size=5, ascending="true", message_to_check=stored)
assert len(self.store_response.messages) == 2