Example #1
0
    def get_accounts(client_id):
        less_than = request.args.get('amountLessThan')
        greater_than = request.args.get('amountGreaterThan')
        accounts = []
        if less_than is not None and greater_than is not None:
            accounts = AccountService.get_account_by_client_between(
                client_id, less_than, greater_than)
        else:
            accounts = AccountService.get_accounts_by_client(client_id)

        return (jsonify(accounts), 200) if accounts else ("Accounts Not Found",
                                                          404)
 def test_01_get_all(self):
     accounts = AccountService.get_accounts_by_client(1)
     AccountServiceTest.account = Account.deserialize(accounts.pop())
     self.assertTrue(accounts)