fix tests

This commit is contained in:
Alex Stokes 2019-10-28 20:38:43 +09:00
parent 0ca3e83540
commit 3deccac2da
No known key found for this signature in database
GPG Key ID: 51CE1721B245C086
2 changed files with 4 additions and 3 deletions

View File

@ -7,8 +7,8 @@ from libp2p.host.defaults import get_default_protocols
def test_default_protocols():
key_pair = create_new_key_pair()
swarm = initialize_default_swarm(key_pair)
host = BasicHost(swarm)
host = BasicHost(key_pair.public_key, swarm)
mux = host.get_mux()
handlers = mux.handlers
assert handlers == get_default_protocols()
assert handlers == get_default_protocols(host)

View File

@ -14,6 +14,7 @@ import enum
import pytest
from libp2p.crypto.rsa import create_new_key_pair
from libp2p.network.notifee_interface import INotifee
from tests.configs import LISTEN_MADDR
from tests.factories import SwarmFactory
@ -56,7 +57,7 @@ class MyNotifee(INotifee):
@pytest.mark.asyncio
async def test_notify(is_host_secure):
swarms = [SwarmFactory(is_host_secure) for _ in range(2)]
swarms = [SwarmFactory(is_host_secure, create_new_key_pair()) for _ in range(2)]
events_0_0 = []
events_1_0 = []