async def setUp(self): self.user = User(**USER_WITH_MULTIPLE_ACCOUNTS_DICT) self.account = Account(**ACCOUNT_DEV_DICT) self.account.owner = "asgard" self.account_dev = Account(**ACCOUNT_DEV_DICT) self.mesos_backend = MesosOrchestrator(MesosAgentsBackend(), MarathonAppsBackend())
async def setUp(self): await super(AgentsServiceTest, self).setUp() self.mesos_orchestrator = MesosOrchestrator( agents_backend=MesosAgentsBackend(), apps_backend=MarathonAppsBackend(), ) self.user = User(**USER_WITH_MULTIPLE_ACCOUNTS_DICT) self.account = Account(**ACCOUNT_DEV_DICT) self.agents_service = AgentsService()
async def test_get_app_stats_calls_backend_with_correct_parameters(self): app = MesosApp(id="my-app") interval = Interval.ONE_HOUR apps_backend_mock = mock.CoroutineMock( get_app_stats=mock.CoroutineMock()) mesos_orchestrator = MesosOrchestrator(MesosAgentsBackend(), apps_backend_mock) await mesos_orchestrator.get_app_stats(app, self.user, interval, self.account) apps_backend_mock.get_app_stats.assert_awaited_with( app, self.user, interval, self.account)
from asgard.backends.marathon.impl import MarathonAppsBackend from asgard.backends.mesos.impl import MesosOrchestrator, MesosAgentsBackend mesos = MesosOrchestrator(MesosAgentsBackend(), MarathonAppsBackend())