gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated (f8bd2b5 -> 5a8ac4b)


From: gnunet
Subject: [libeufin] branch master updated (f8bd2b5 -> 5a8ac4b)
Date: Fri, 13 Nov 2020 18:52:33 +0100

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

ms pushed a change to branch master
in repository libeufin.

    from f8bd2b5  provide 'make check'
     new b4702b9  Integration tests.
     new 5a8ac4b  Integration tests.

The 2 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:
 integration-tests/test.py | 64 +++++++++++++++++++++++++++++++++++++++++++++++
 integration-tests/util.py | 37 +++++++++++++++++++++++++++
 2 files changed, 101 insertions(+)
 create mode 100755 integration-tests/test.py

diff --git a/integration-tests/test.py b/integration-tests/test.py
new file mode 100755
index 0000000..cd77b44
--- /dev/null
+++ b/integration-tests/test.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python3
+
+from util import startNexus, startSandbox, assertResponse, flushTablesSandbox
+from requests import post, get
+
+# Databases
+NEXUS_DB="/tmp/test-nexus.sqlite3"
+SANDBOX_DB="/tmp/test-sandbox.sqlite3"
+
+# Nexus user details
+NEXUS_USERNAME = "person"
+NEXUS_PASSWORD = "y"
+
+# EBICS details
+EBICS_URL = "http://localhost:5000/ebicsweb";
+EBICS_HOST = "HOST01"
+EBICS_PARTNER = "PARTNER1"
+EBICS_USER = "USER1"
+EBICS_VERSION = "H004"
+
+# Subscriber's bank account at the Sandbox
+BANK_IBAN = "GB33BUKB20201555555555"
+BANK_BIC = "BUKBGB22"
+BANK_NAME = "Oliver Smith"
+BANK_LABEL = "savings"
+
+def prepareSandbox():
+    # make ebics host at sandbox
+    assertResponse(
+        post(
+            "http://localhost:5000/admin/ebics/host";,
+            json=dict(hostID=EBICS_HOST, ebicsVersion=EBICS_VERSION),
+        )
+    )
+    
+    # make new ebics subscriber at sandbox
+    assertResponse(
+        post(
+            "http://localhost:5000/admin/ebics/subscribers";,
+            json=dict(hostID=EBICS_HOST, partnerID=EBICS_PARTNER, 
userID=EBICS_USER),
+        )
+    )
+    
+    # give a bank account to such subscriber, at sandbox
+    assertResponse(
+        post(
+            "http://localhost:5000/admin/ebics/bank-accounts";,
+            json=dict(
+                subscriber=dict(hostID=EBICS_HOST, partnerID=EBICS_PARTNER, 
userID=EBICS_USER),
+                iban=BANK_IBAN,
+                bic=BANK_BIC,
+                name=BANK_NAME,
+                label=BANK_LABEL
+            )
+        )
+    )
+
+startNexus(NEXUS_DB)
+startSandbox(SANDBOX_DB)
+
+prepareSandbox()
+print("Services correctly started.")
+print("Emptying tables at Sandbox")
+flushTablesSandbox(SANDBOX_DB)
diff --git a/integration-tests/util.py b/integration-tests/util.py
index 76d68bc..27d8d17 100644
--- a/integration-tests/util.py
+++ b/integration-tests/util.py
@@ -46,6 +46,43 @@ def kill(name, s):
     s.terminate()
     s.wait()
 
+def flushTablesSandbox(dbName):
+    check_call(
+        ["sqlite3",
+         dbName,
+         "DELETE FROM BankAccountReports",
+         "DELETE FROM EbicsOrderSignatures",
+         "DELETE FROM BankAccountStatements",
+         "DELETE FROM EbicsSubscriberPublicKeys",
+         "DELETE FROM BankAccountTransactions",
+         "DELETE FROM EbicsSubscribers",
+         "DELETE FROM BankAccounts",
+         "DELETE FROM EbicsUploadTransactionChunks",
+         "DELETE FROM EbicsDownloadTransactions",
+         "DELETE FROM EbicsUploadTransactions",
+         "DELETE FROM EbicsHosts"
+        ]
+     )
+
+def flushTablesNexus(dbName):
+    check_call(
+        ["sqlite3",
+         dbName,
+         "DELETE FROM EbicsSubscribers",
+         "DELETE FROM NexusBankTransactions",
+         "DELETE FROM TalerFacadeState",
+         "DELETE FROM Facades",
+         "DELETE FROM NexusScheduledTasks",
+         "DELETE FROM TalerIncomingPayments",
+         "DELETE FROM NexusBankAccounts",
+         "DELETE FROM NexusUsers",
+         "DELETE FROM TalerRequestedPayments",
+         "DELETE FROM NexusBankConnections",
+         "DELETE FROM OfferedBankAccounts",
+         "DELETE FROM NexusBankMessages",
+         "DELETE FROM PaymentInitiations"
+        ]
+    )
 
 def startSandbox(dbname="sandbox-test.sqlite3"):
     db_full_path = str(Path.cwd() / dbname)

-- 
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]