address review comments

This commit is contained in:
fbarbu15 2023-12-27 09:27:30 +02:00
parent b6a9c0b1cd
commit 4a9f0e3ef0
No known key found for this signature in database
GPG Key ID: D75221C8DEA22501
7 changed files with 14 additions and 14 deletions

View File

@ -78,7 +78,7 @@ class WakuNode:
}
default_args.update(nwaku_args)
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
for key, value in kwargs.items():
key = key.replace("_", "-")

View File

@ -186,7 +186,7 @@ class StepsFilter:
elif node.is_nwaku():
return node.get_filter_messages(content_topic)
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
@allure.step
def create_message(self, **kwargs):

View File

@ -95,7 +95,7 @@ class TestFilterSubscribeCreate(StepsFilter):
elif self.node2.is_gowaku():
pass
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
except Exception as ex:
assert "Bad Request" in str(ex)
@ -134,6 +134,6 @@ class TestFilterSubscribeCreate(StepsFilter):
elif self.node2.is_gowaku():
pass
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
except Exception as ex:
assert "Bad Request" in str(ex)

View File

@ -44,7 +44,7 @@ class TestFilterUnSubscribe(StepsFilter):
status="can't unsubscribe" if self.node2.is_gowaku() else "",
)
except Exception as ex:
assert "Not Found" and "peer has no subscriptions" in str(ex)
assert "Not Found" in str(ex) and "peer has no subscriptions" in str(ex)
self.check_published_message_reaches_filter_peer()
def test_filter_unsubscribe_from_non_existing_pubsub_topic(self):
@ -57,9 +57,9 @@ class TestFilterUnSubscribe(StepsFilter):
elif self.node2.is_gowaku():
pass
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
except Exception as ex:
assert "Not Found" and "peer has no subscriptions" in str(ex)
assert "Not Found" in str(ex) and "peer has no subscriptions" in str(ex)
self.check_published_message_reaches_filter_peer()
def test_filter_unsubscribe_from_31_content_topics(self):
@ -69,7 +69,7 @@ class TestFilterUnSubscribe(StepsFilter):
)
raise AssertionError("Unsubscribe from more than 30 content topics worked!!!")
except Exception as ex:
assert "Not Found" and "exceeds maximum content topics: 30" in str(ex)
assert "Not Found" in str(ex) and "exceeds maximum content topics: 30" in str(ex)
def test_filter_unsubscribe_with_no_content_topic(self):
try:
@ -120,7 +120,7 @@ class TestFilterUnSubscribe(StepsFilter):
elif self.node2.is_gowaku():
pass
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
except Exception as ex:
assert "Bad Request" in str(ex)
@ -141,7 +141,7 @@ class TestFilterUnSubscribe(StepsFilter):
elif self.node2.is_gowaku():
pass
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
except Exception as ex:
assert "Bad Request" in str(ex)

View File

@ -46,11 +46,11 @@ class TestFilterUnSubscribeAll(StepsFilter):
raise AssertionError("Unsubscribe all on peer without subscriptions worked!!!")
except Exception as ex:
if self.node2.is_nwaku():
assert "Not Found" and "peer has no subscriptions" in str(ex)
assert "Not Found" in str(ex) and "peer has no subscriptions" in str(ex)
elif self.node2.is_gowaku():
assert "subscription not found" in str(ex)
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
def test_filter_unsubscribe_all_with_invalid_request_id(self, subscribe_main_nodes):
try:

View File

@ -194,7 +194,7 @@ class TestRelayPublish(StepsRelay):
elif self.node1.is_gowaku():
pass
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
except Exception as ex:
assert "Bad Request" in str(ex)

View File

@ -76,7 +76,7 @@ class TestRelaySubscribe(StepsRelay):
elif self.node1.is_gowaku():
raise AssertionError("Unsubscribe from non-subscribed pubsub_topic worked!!!")
else:
raise NotImplemented("Not implemented for this node type")
raise NotImplementedError("Not implemented for this node type")
except Exception as ex:
assert "Bad Request" in str(ex) or "Internal Server Error" in str(ex)
self.check_published_message_reaches_relay_peer()