From 1bf0c31d1f579240fd7c3832e9bbae1dafcbc86a Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Thu, 24 Oct 2019 17:36:34 +0900 Subject: [PATCH] add basic test for default protocols --- tests/host/test_basic_host.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/host/test_basic_host.py diff --git a/tests/host/test_basic_host.py b/tests/host/test_basic_host.py new file mode 100644 index 00000000..5718b6de --- /dev/null +++ b/tests/host/test_basic_host.py @@ -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()