From c270bda45602569e4c74f71ca6ed3245223bf909 Mon Sep 17 00:00:00 2001 From: Stuckinaboot Date: Wed, 3 Apr 2019 14:17:33 -0400 Subject: [PATCH] Add test for multiple messages from two origins --- tests/pubsub/test_floodsub.py | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/pubsub/test_floodsub.py b/tests/pubsub/test_floodsub.py index ba9d33c..00ac956 100644 --- a/tests/pubsub/test_floodsub.py +++ b/tests/pubsub/test_floodsub.py @@ -433,3 +433,57 @@ async def test_three_nodes_clique_two_topic_diff_origin_test_obj(): ] } await perform_test_from_obj(test_obj) + +@pytest.mark.asyncio +async def test_four_nodes_clique_two_topic_diff_origin_many_msgs_test_obj(): + test_obj = { + "supported_protocols": ["/floodsub/1.0.0"], + "adj_list": { + "1": ["2", "3", "4"], + "2": ["1", "3", "4"], + "3": ["1", "2", "4"], + "4": ["1", "2", "3"] + }, + "topic_map": { + "astrophysics": ["1", "2", "3", "4"], + "school": ["1", "2", "3", "4"] + }, + "messages": [ + { + "topics": ["astrophysics"], + "data": "e=mc^2", + "node_id": "1" + }, + { + "topics": ["school"], + "data": "foobar", + "node_id": "2" + }, + { + "topics": ["astrophysics"], + "data": "I am allergic", + "node_id": "1" + }, + { + "topics": ["school"], + "data": "foobar2", + "node_id": "2" + }, + { + "topics": ["astrophysics"], + "data": "I am allergic2", + "node_id": "1" + }, + { + "topics": ["school"], + "data": "foobar3", + "node_id": "2" + }, + { + "topics": ["astrophysics"], + "data": "I am allergic3", + "node_id": "1" + } + ] + } + await perform_test_from_obj(test_obj)