def test_list_bots(self): bot = list(AccountProcessor.list_bots(pytest.account)) assert bot[0]['name'] == 'test' assert bot[0]['_id']
def test_list_bots_none(self): assert not list(AccountProcessor.list_bots(5))
def test_update_bot_name(self): AccountProcessor.update_bot('test_bot', pytest.bot) bot = list(AccountProcessor.list_bots(pytest.account)) assert bot[0]['name'] == 'test_bot' assert bot[0]['_id']
def test_delete_bot(self): bot = list(AccountProcessor.list_bots(pytest.account)) pytest.deleted_bot = bot[1]['_id'] AccountProcessor.delete_bot(bot[1]['_id'], 'testAdmin')
async def list_bots(current_user: User = Depends(auth.get_current_user)): """ List bots for account. """ bots = list(AccountProcessor.list_bots(current_user.account)) return Response(data=bots)