Esempio n. 1
0
async def delete_bot(bot: str,
                     current_user: User = Depends(auth.get_current_user)):
    """
    Deletes bot.
    """
    AccountProcessor.delete_bot(bot, current_user.get_user())
    return {'message': 'Bot removed'}
Esempio n. 2
0
 def test_delete_bot_not_exists(self):
     with pytest.raises(AppException):
         AccountProcessor.delete_bot(pytest.deleted_bot, 'testAdmin')
Esempio n. 3
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')