aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-10-29 17:01:12 +0100
committerMS <ms@taler.net>2020-10-29 17:01:12 +0100
commitd7878cb5d05c76959ca97f8fca79ea93afe0d02b (patch)
tree190855ec2845ea6437c8aa4535c69102fbc9ec23
parenteb51193269d8cec1abfd89c266ba74753dd97e01 (diff)
downloadlibeufin-d7878cb5d05c76959ca97f8fca79ea93afe0d02b.tar.gz
libeufin-d7878cb5d05c76959ca97f8fca79ea93afe0d02b.tar.bz2
libeufin-d7878cb5d05c76959ca97f8fca79ea93afe0d02b.zip
checks
-rw-r--r--integration-tests/json_checks.py15
-rwxr-xr-xintegration-tests/test-ebics-highlevel.py8
2 files changed, 19 insertions, 4 deletions
diff --git a/integration-tests/json_checks.py b/integration-tests/json_checks.py
index 282d79b7..a0a54bce 100644
--- 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
index 3fa47bab..bb49e312 100755
--- 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!")