mirror of
https://github.com/logos-messaging/logos-messaging-interop-tests.git
synced 2026-01-02 14:03:08 +00:00
fix minor issues and adding comments
This commit is contained in:
parent
a62e204776
commit
15472c6151
@ -182,7 +182,7 @@ class TestTimeFilter(StepsStore):
|
||||
store_response = self.get_messages_from_store(node, page_size=20, end_time=end_time, include_data=True)
|
||||
logger.debug(f"number of messages stored for " f"end time = {end_time} is {len(store_response.messages)}")
|
||||
|
||||
assert len(store_response.messages) == 0, "number of messages retrieved doesn't match time filter "
|
||||
assert len(store_response.messages) == 6, "number of messages retrieved doesn't match time filter "
|
||||
|
||||
def test_time_filter_zero_end_time(self):
|
||||
for timestamp in self.ts_pass:
|
||||
@ -193,7 +193,7 @@ class TestTimeFilter(StepsStore):
|
||||
for node in self.store_nodes:
|
||||
store_response = self.get_messages_from_store(node, page_size=20, end_time=end_time, include_data=True)
|
||||
logger.debug(f"number of messages stored for " f"end time = {end_time} is {len(store_response.messages)}")
|
||||
assert len(store_response.messages) == 0, "number of messages retrieved doesn't match time filter "
|
||||
assert len(store_response.messages) == 6, "number of messages retrieved doesn't match time filter "
|
||||
|
||||
def test_time_filter_negative_start_time(self):
|
||||
for timestamp in self.ts_pass:
|
||||
@ -205,7 +205,7 @@ class TestTimeFilter(StepsStore):
|
||||
store_response = self.get_messages_from_store(node, page_size=20, start_time=start_time, include_data=True)
|
||||
logger.debug(f"number of messages stored for " f"start time = {start_time} is {len(store_response.messages)}")
|
||||
|
||||
assert len(store_response.messages) == 0, "number of messages retrieved doesn't match time filter "
|
||||
assert len(store_response.messages) == 6, "number of messages retrieved doesn't match time filter "
|
||||
|
||||
def test_time_filter_zero_start_time(self):
|
||||
for timestamp in self.ts_pass:
|
||||
@ -217,7 +217,7 @@ class TestTimeFilter(StepsStore):
|
||||
store_response = self.get_messages_from_store(node, page_size=20, start_time=start_time, include_data=True)
|
||||
logger.debug(f"number of messages stored for " f"start time = {start_time} is {len(store_response.messages)}")
|
||||
|
||||
assert len(store_response.messages) == 0, "number of messages retrieved doesn't match time filter "
|
||||
assert len(store_response.messages) == 6, "number of messages retrieved doesn't match time filter "
|
||||
|
||||
def test_time_filter_zero_start_end_time(self):
|
||||
for timestamp in self.ts_pass:
|
||||
@ -230,7 +230,7 @@ class TestTimeFilter(StepsStore):
|
||||
store_response = self.get_messages_from_store(node, page_size=20, start_time=start_time, end_time=end_time, include_data=True)
|
||||
logger.debug(f"number of messages stored for " f"start time = {start_time} is {len(store_response.messages)}")
|
||||
|
||||
assert len(store_response.messages) == 0, "number of messages retrieved doesn't match time filter "
|
||||
assert len(store_response.messages) == 6, "number of messages retrieved doesn't match time filter "
|
||||
|
||||
def test_time_filter_invalid_start_time(self):
|
||||
for timestamp in self.ts_pass:
|
||||
|
||||
@ -85,24 +85,26 @@ class TestTopics(StepsStore):
|
||||
assert len(store_response["messages"]) == len(CONTENT_TOPICS_DIFFERENT_SHARDS), "Message count mismatch"
|
||||
|
||||
def test_store_with_not_valid_content_topic(self):
|
||||
empty_content_topic = ""
|
||||
empty_content_topic = "##"
|
||||
logger.debug(f"trying to find stored messages with wrong content_topic ={empty_content_topic}")
|
||||
for node in self.store_nodes:
|
||||
store_response = node.get_store_messages(page_size=20, include_data="true", ascending="true", content_topics=empty_content_topic)
|
||||
assert len(store_response["messages"]) == len(CONTENT_TOPICS_DIFFERENT_SHARDS), "Message count mismatch"
|
||||
assert len(store_response["messages"]) == 0, "Messages shouldn't ne retrieved with invalid content_topic"
|
||||
# test with space string content topic
|
||||
space_content_topic = " "
|
||||
try:
|
||||
store_response = self.store_nodes[0].get_store_messages(
|
||||
page_size=20, include_data="true", ascending="true", content_topics=space_content_topic
|
||||
)
|
||||
logger.debug(f" response for empty content_topic {store_response}")
|
||||
logger.debug(f" response for invalid content_topic {store_response}")
|
||||
assert store_response["messages"] == [], "message stored with wrong topic "
|
||||
except Exception as e:
|
||||
raise Exception("couldn't get stored message")
|
||||
raise Exception("couldn't get stored message with invalid content_topic")
|
||||
|
||||
def test_store_with_wrong_url_content_topic(self):
|
||||
# test with wrong url
|
||||
wrong_content_topic = "myapp/1/latest/proto"
|
||||
logger.debug(f"trying to find stored messages with wrong content_topic ={wrong_content_topic}")
|
||||
try:
|
||||
store_response = self.store_nodes[0].get_store_messages(
|
||||
page_size=20, include_data="true", ascending="true", content_topics=wrong_content_topic
|
||||
@ -110,7 +112,7 @@ class TestTopics(StepsStore):
|
||||
logger.debug(f" response for wrong url content topic is {store_response}")
|
||||
assert store_response["messages"] == [], "message stored with wrong topic "
|
||||
except Exception as e:
|
||||
raise Exception("couldn't get stored message")
|
||||
raise Exception(f"couldn't get stored message with wrong url {wrong_content_topic}")
|
||||
|
||||
def test_store_with_empty_pubsub_topics(self):
|
||||
# empty pubsub topic
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user