def test_connections():
    node = DummyNode()
    node.id = "node_id"
    actor = create_actor(node)
    inport = actor.inports['token']
    outport = actor.outports['token']

    port = Mock()
    port.id = "x"
    peer_port = Mock()
    peer_port.id = "y"

    inport.attach_endpoint(LocalInEndpoint(port, peer_port))
    outport.attach_endpoint(LocalOutEndpoint(port, peer_port))

    assert actor.connections(node) == {
        'actor_id': actor.id,
        'actor_name': actor.name,
        'inports': {inport.id: (node, "y")},
        'outports': {outport.id: [(node, "y")]}
    }
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/tests/test_actor.py/test_connections/original