async def test_agent_message(unused_tcp_port_factory): receiver_port = unused_tcp_port_factory() sender_port = unused_tcp_port_factory() _, (percept_log, action_log) = await gather( run_agent("Rick", receiver_port, receiver, sender_addr=local_address(sender_port)), run_agent("Sally", sender_port, sender, receiver_addr=local_address(receiver_port)) ) await sleep(1) # TODO: figure out how to run the replay on the virtual time event loop. test_loop = VirtualTimeEventLoop() await replay_agent("S_l_y", percept_log, sender, receiver_addr=local_address(receiver_port))
def event_loop(): loop = VirtualTimeEventLoop() yield loop loop.close()
def event_loop() -> Generator[Any, Any, Any]: loop = VirtualTimeEventLoop() yield loop loop.close()