gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated (29b500f -> 704db44)


From: gnunet
Subject: [libeufin] branch master updated (29b500f -> 704db44)
Date: Thu, 19 Nov 2020 12:54:41 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a change to branch master
in repository libeufin.

    from 29b500f  fix URL
     new 8a9a04f  fix tests return code
     new 19e221d  Introduce a Taler facade test (now failing!).
     new 704db44  Integration tests.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Makefile                   |  2 +-
 integration-tests/tests.py | 96 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a454ceb..d7eee38 100644
--- a/Makefile
+++ b/Makefile
@@ -43,4 +43,4 @@ check:
 
 .PHONY: tests
 tests:
-       @cd integration-tests; py.test tests.py; cd ..
+       @cd integration-tests; py.test tests.py
diff --git a/integration-tests/tests.py b/integration-tests/tests.py
index 07a3d21..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 (
@@ -42,6 +43,9 @@ BANK_BIC = "BUKBGB22"
 BANK_NAME = "Oliver Smith"
 BANK_LABEL = "savings"
 
+# Facade details
+TALER_FACADE="my-taler-facade"
+
 def prepareSandbox():
     # make ebics host at sandbox
     assertResponse(
@@ -149,6 +153,8 @@ def test_imported_account():
     imported_account = resp.json().get("accounts").pop()
     assert imported_account.get("nexusBankAccountId") == NEXUS_BANK_LABEL
 
+# Expecting a empty history for an account that
+# never made or receivd a payment.
 def test_empty_history():
     resp = assertResponse(
         get(
@@ -158,6 +164,9 @@ def test_empty_history():
     )
     assert len(resp.json().get("transactions")) == 0
 
+# This test checks the bank connection backup export+import 
+# However the restored connection is never sent through the
+# "/connect" step.
 def test_backup():
     resp = assertResponse(
         post(
@@ -183,6 +192,8 @@ def test_ebics_custom_ebics_order():
         )
     )
 
+# This test makes a payment and expects to see it
+# in the account history.
 def test_payment():
     resp = assertResponse(
         post(
@@ -218,3 +229,88 @@ def test_payment():
         )
     )
     assert len(resp.json().get("transactions")) == 1
+
+# This test makes one payment via the Taler facade,
+# and expects too see it in the outgoing history.
+def test_taler_facade():
+    assertResponse(
+        post(
+            f"{N}/facades",
+            json=dict(
+                name=TALER_FACADE,
+                type="taler-wire-gateway",
+                creator=NEXUS_USERNAME,
+                config=dict(
+                    bankAccount=NEXUS_BANK_LABEL,
+                    bankConnection=NEXUS_BANK_CONNECTION,
+                    reserveTransferLevel="UNUSED",
+                    intervalIncremental="UNUSED"
+                )
+            ),
+            auth=NEXUS_AUTH
+        )
+    )
+    assertResponse(
+        post(
+            f"{N}/facades/{TALER_FACADE}/taler/transfer",
+            json=dict(
+                request_uid="0",
+                amount="EUR:1",
+                exchange_base_url="http//url",
+                wtid="nice",
+                
credit_account="payto://iban/THEBIC/THEIBAN?receiver-name=theName"
+            ),
+            auth=NEXUS_AUTH
+        )
+    
+    )
+    sleep(5) # Let automatic tasks ingest the history.
+    resp = assertResponse(
+        get(
+            f"{N}/facades/{TALER_FACADE}/taler/history/outgoing?delta=5",
+            auth=NEXUS_AUTH
+        )
+    )
+    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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]