Mocks & testing
Prepared bus and broker mocks for testing based on unittest.mock.AsyncMock
from microagent.tools.mocks import BusMock, BrokerMock
agent = Agent(bus=BusMock(), broker=BrokerMock())
agent.bus.user_created.send.assert_called()
agent.bus.user_created.call.assert_called()
agent.broker.mailing.send.assert_called()
agent.broker.mailing.length.assert_called()