예제 #1
0
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()
예제 #2
0
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
    # NOTE: comparing keys for equality as handlers may be closures that do not compare in the way
    # this test is concerned with
    assert handlers.keys() == get_default_protocols(host).keys()