From d693b7b6afe738840f6a0fe5dedebc402a0a55e8 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Mon, 11 Dec 2023 10:28:54 +0200 Subject: [PATCH] address review comments --- src/node/api_clients/rpc.py | 4 ++-- src/steps/relay.py | 2 +- tests/filter/test_subscribe_update.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/api_clients/rpc.py b/src/node/api_clients/rpc.py index fd30b8a1..e665c11e 100644 --- a/src/node/api_clients/rpc.py +++ b/src/node/api_clients/rpc.py @@ -44,8 +44,8 @@ class RPC(BaseClient): set_subscriptions_response = self.rpc_call( "post_waku_v2_filter_v1_subscription", [ - subscription["contentFilters"] if "contentFilters" in subscription else [], - subscription["pubsubTopic"] if "pubsubTopic" in subscription else None, + subscription.get("contentFilters", []), + subscription.get("pubsubTopic", None), ], ) return set_subscriptions_response.json()["result"] diff --git a/src/steps/relay.py b/src/steps/relay.py index 64798b2a..78336c57 100644 --- a/src/steps/relay.py +++ b/src/steps/relay.py @@ -59,7 +59,7 @@ class StepsRelay: except Exception as ex: raise TimeoutError(f"WARM UP FAILED WITH: {ex}") - # this method should be used only for the tests that use the warm_up fixture + # this method should be used only for the tests that use the relay_warm_up fixture # otherwise use wait_for_published_message_to_reach_relay_peer @allure.step def check_published_message_reaches_relay_peer(self, message=None, pubsub_topic=None, message_propagation_delay=0.1, sender=None, peer_list=None): diff --git a/tests/filter/test_subscribe_update.py b/tests/filter/test_subscribe_update.py index bd089013..54b20411 100644 --- a/tests/filter/test_subscribe_update.py +++ b/tests/filter/test_subscribe_update.py @@ -67,7 +67,7 @@ class TestFilterSubscribeCreate(StepsFilter): except Exception as ex: assert "Bad Request" in str(ex) - def test_filter_update_subscription_with_invalid_pubsub_topic_format(self, subscribe_main_nodes): + def test_filter_update_subscription_with_pubsub_topic_list_instead_of_string(self, subscribe_main_nodes): try: self.update_filter_subscription({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": [self.test_pubsub_topic]}) raise AssertionError(f"Subscribe with invalid pubusub topics worked!!!")