def test_empty_slurp_list(self): mock_sts().start() watcher = IAMRole(accounts=[self.account.name]) watcher.list_method = lambda **kwargs: [] _, exceptions = watcher.slurp_list() assert len(exceptions) == 0 assert len(watcher.total_list) == 0 assert watcher.done_slurping
def test_empty_slurp_list(self): mock_sts().start() watcher = IAMRole(accounts=[self.account.name]) watcher.list_method = lambda **kwargs: [] _, exceptions = watcher.slurp_list() assert len(exceptions) == 0 assert len(watcher.total_list) == 0 assert watcher.done_slurping mock_sts().stop()
def test_slurp_list_exceptions(self): mock_sts().start() watcher = IAMRole(accounts=[self.account.name]) def raise_exception(): raise Exception("LOL, HAY!") watcher.list_method = lambda **kwargs: raise_exception() _, exceptions = watcher.slurp_list() assert len(exceptions) == 1 assert len(ExceptionLogs.query.all()) == 1
def test_slurp_list_exceptions(self): mock_sts().start() watcher = IAMRole(accounts=[self.account.name]) def raise_exception(): raise Exception("LOL, HAY!") watcher.list_method = lambda **kwargs: raise_exception() _, exceptions = watcher.slurp_list() assert len(exceptions) == 1 assert len(ExceptionLogs.query.all()) == 1 mock_sts().stop()