libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit d7878cb5d05c76959ca97f8fca79ea93afe0d02b
parent eb51193269d8cec1abfd89c266ba74753dd97e01
Author: MS <ms@taler.net>
Date:   Thu, 29 Oct 2020 17:01:12 +0100

checks

Diffstat:
Mintegration-tests/json_checks.py | 15+++++++++++++++
Mintegration-tests/test-ebics-highlevel.py | 8++++----
2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/integration-tests/json_checks.py b/integration-tests/json_checks.py @@ -20,6 +20,21 @@ def checkPreparePayment(json): ) return c.check(json) +def checkPreparedPaymentResponse(json): + c = T(F("uuid")) + return c.check(json) + +def checkTransaction(json): + c = T( + F("account"), + F("counterpartIban"), + F("counterpartBic"), + F("counterpartName"), + F("amount"), + F("date"), + F("subject") + ) + def checkNewEbicsConnection(json): c = T( F("source"), diff --git a/integration-tests/test-ebics-highlevel.py b/integration-tests/test-ebics-highlevel.py @@ -7,7 +7,7 @@ import hashlib import base64 from util import startNexus, startSandbox, assertResponse -from json_checks import checkNewEbicsConnection, checkPreparePayment +from json_checks import checkNewEbicsConnection, checkPreparePayment, checkTransaction, checkPreparedPaymentResponse # Steps implemented in this test. # @@ -181,9 +181,8 @@ resp = assertResponse( headers=dict(Authorization=USER_AUTHORIZATION_HEADER), ) ) +checkPreparedPaymentResponse(resp) PREPARED_PAYMENT_UUID = resp.json().get("uuid") -if PREPARED_PAYMENT_UUID == None: - fail("Payment UUID not received") # 5.b, submit payment initiation assertResponse( @@ -210,9 +209,10 @@ resp = assertResponse( ) transactions = resp.json().get("transactions") - if len(transactions) != 1: print(transactions) fail(f"Unexpected number of transactions ({len(transactions)}); should be 1") +checkTransactions(transactions[0]) + print("Test passed!")