Ejemplo n.º 1
0
    def edit_account_balance(client_id, account_id):

        action = request.json["action"]

        if action == 'withdraw':
            return AccountService.withdrawal_account(client_id, account_id,
                                                     request.json["amount"])
        elif action == 'deposit':
            return AccountService.deposit_account(client_id, account_id,
                                                  request.json["amount"])
        else:
            logger.log(f"{request.json}")
            return """Body must contain a JSON with an action property and values of withdrawal or deposit and
                      an amount property with a valid number""", 400
Ejemplo n.º 2
0
 def test_93_deposit(self):
     response = AccountService.deposit_account(
         1, AccountServiceTest.account.id, 400)
     self.assertEqual(response[1], 200)