Exemple #1
0
 def test_list_bots(self):
     bot = list(AccountProcessor.list_bots(pytest.account))
     assert bot[0]['name'] == 'test'
     assert bot[0]['_id']
Exemple #2
0
 def test_list_bots_none(self):
     assert not list(AccountProcessor.list_bots(5))
Exemple #3
0
 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']
Exemple #4
0
 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')
Exemple #5
0
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)