add basic test for default protocols
This commit is contained in:
parent
15cabb1c33
commit
1bf0c31d1f
14
tests/host/test_basic_host.py
Normal file
14
tests/host/test_basic_host.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
from libp2p import initialize_default_swarm
|
||||||
|
from libp2p.crypto.rsa import create_new_key_pair
|
||||||
|
from libp2p.host.basic_host import BasicHost
|
||||||
|
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)
|
||||||
|
|
||||||
|
mux = host.get_mux()
|
||||||
|
handlers = mux.handlers
|
||||||
|
assert handlers == get_default_protocols()
|
Loading…
Reference in New Issue
Block a user