Combine test_subscription.py to test_pubsub.py

And add a bunch of tests for pubsub
This commit is contained in:
mhchia
2019-07-28 18:07:48 +08:00
parent 96563c0d84
commit 550289a439
5 changed files with 125 additions and 20 deletions

View File

@ -3,8 +3,8 @@ import pytest
from libp2p.pubsub.mcache import MessageCache
# pylint: disable=too-few-public-methods
class Msg:
def __init__(self, topicIDs, seqno, from_id):
# pylint: disable=invalid-name
self.topicIDs = topicIDs
@ -15,8 +15,7 @@ class Msg:
@pytest.mark.asyncio
async def test_mcache():
# Ported from:
# https://github.com/libp2p/go-libp2p-pubsub
# /blob/51b7501433411b5096cac2b4994a36a68515fc03/mcache_test.go
# https://github.com/libp2p/go-libp2p-pubsub/blob/51b7501433411b5096cac2b4994a36a68515fc03/mcache_test.go
mcache = MessageCache(3, 5)
msgs = []