def test_addHandler():
    m = Manager()
    m.start()

    m.addHandler(on_foo)

    waiter = pytest.WaitEvent(m, "foo")
    x = m.fire(foo())
    waiter.wait()

    s = x.value
    assert s == "Hello World!"

    m.stop()
dataset/ETHPy150Open circuits/circuits/tests/core/test_dynamic_handlers.py/test_addHandler/original