[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 03/03: Integration tests.
From: |
gnunet |
Subject: |
[libeufin] 03/03: Integration tests. |
Date: |
Thu, 19 Nov 2020 12:54:44 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
commit 704db446040257f338bb731c478fd3fe388e09be
Author: MS <ms@taler.net>
AuthorDate: Tue Nov 17 21:42:46 2020 +0100
Integration tests.
Add test to get Nexus submit twice one same payment
at the Sandbox.
---
integration-tests/tests.py | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/integration-tests/tests.py b/integration-tests/tests.py
index 983fd83..cbad178 100755
--- a/integration-tests/tests.py
+++ b/integration-tests/tests.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
+from subprocess import check_call
from requests import post, get, auth
from time import sleep
from util import (
@@ -271,3 +272,45 @@ def test_taler_facade():
)
)
assert len(resp.json().get("outgoing_transactions")) == 1
+
+def test_payment_double_submission():
+ resp = assertResponse(
+ post(
+ f"{N}/bank-accounts/{NEXUS_BANK_LABEL}/payment-initiations",
+ json=dict(
+ iban="FR7630006000011234567890189",
+ bic="AGRIFRPP",
+ name="Jacques La Fayette",
+ subject="integration test",
+ amount="EUR:1",
+ ),
+ auth=NEXUS_AUTH
+ )
+ )
+ PAYMENT_UUID = resp.json().get("uuid")
+ assert PAYMENT_UUID
+ assertResponse(
+ post(
+
f"{N}/bank-accounts/{NEXUS_BANK_LABEL}/payment-initiations/{PAYMENT_UUID}/submit",
+ json=dict(),
+ auth=NEXUS_AUTH
+ )
+ )
+ check_call([
+ "sqlite3",
+ NEXUS_DB,
+ f"UPDATE PaymentInitiations SET submitted = false WHERE id =
'{PAYMENT_UUID}'"
+ ])
+ # Submit payment the _second_ time, expecting 500 from Nexus.
+ # FIXME:
+ # Sandbox does return a EBICS_PROCESSING_ERROR code, but Nexus
+ # (currently) is not able to extract any meaning from it. Ideally,
+ # Nexus should print both the error token _and_ a hint message.
+ assertResponse(
+ post(
+
f"{N}/bank-accounts/{NEXUS_BANK_LABEL}/payment-initiations/{PAYMENT_UUID}/submit",
+ json=dict(),
+ auth=NEXUS_AUTH
+ ),
+ [500]
+ )
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.