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