gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] 05/05: Use helper, fix names.


From: gnunet
Subject: [libeufin] 05/05: Use helper, fix names.
Date: Mon, 14 Dec 2020 09:57:11 +0100

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

ms pushed a commit to branch master
in repository libeufin.

commit 5259e4fe09c41132303ed90a4eb9a6dc3eb2e31d
Author: MS <ms@taler.net>
AuthorDate: Mon Dec 14 09:56:22 2020 +0100

    Use helper, fix names.
---
 integration-tests/tests.py | 23 +++++++++--------------
 integration-tests/util.py  | 15 +++++++++------
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/integration-tests/tests.py b/integration-tests/tests.py
index ec9a8c4..9c22591 100755
--- a/integration-tests/tests.py
+++ b/integration-tests/tests.py
@@ -23,12 +23,12 @@ from util import (
 # Database
 DB = "jdbc:sqlite:/tmp/libeufintestdb"
 SANDBOX_URL = "http://localhost:5000";
-NEXUS_URL = "http://localhost:5000";
+NEXUS_URL = "http://localhost:5001";
 
 PERSONA = LibeufinPersona(
     banking_details = BankingDetails(SANDBOX_URL),
     nexus_details = NexusDetails(NEXUS_URL),
-    ebics_details = EbicsDetails(SANDBOX_URL)
+    ebics_details = EbicsDetails(SANDBOX_URL + "/ebicsweb")
 )
 
 def prepareSandbox():
@@ -36,14 +36,14 @@ def prepareSandbox():
     assertResponse(
         post(
             f"{PERSONA.banking.bank_base_url}/admin/ebics/host",
-            json=dict(hostID=PERSONA.banking.ebics.host, 
ebicsVersion=PERSONA.banking.ebics.version),
+            json=dict(hostID=PERSONA.ebics.host, 
ebicsVersion=PERSONA.ebics.version),
         )
     )
     # make new ebics subscriber at sandbox
     assertResponse(
         post(
             f"{PERSONA.banking.bank_base_url}/admin/ebics/subscribers",
-            json=PERSONA.banking.ebics.get_as_dict(),
+            json=PERSONA.ebics.get_as_dict(with_url=False),
         )
     )
     # give a bank account to such subscriber, at sandbox
@@ -52,10 +52,10 @@ def prepareSandbox():
             f"{PERSONA.banking.bank_base_url}/admin/ebics/bank-accounts",
             json=dict(
                 name=PERSONA.banking.name,
-                subscriber=PERSONA.banking.ebics.get_as_dict(),
+                subscriber=PERSONA.ebics.get_as_dict(with_url=False),
                 iban=PERSONA.banking.iban,
                 bic=PERSONA.banking.bic,
-                label=PERSONA.banking.sandbox_label
+                label=PERSONA.banking.label
             )
         )
     )
@@ -78,7 +78,7 @@ def prepareNexus():
                 name=PERSONA.nexus.bank_connection,
                 source="new",
                 type="ebics",
-                data=PERSONA.banking.ebics.get_as_dict(),
+                data=PERSONA.ebics.get_as_dict(with_url=True),
             ),
             auth=PERSONA.nexus.auth
         )
@@ -104,7 +104,7 @@ def prepareNexus():
         post(
             
f"{PERSONA.nexus.base_url}/bank-connections/{PERSONA.nexus.bank_connection}/import-account",
             json=dict(
-                offeredAccountId=PERSONA.banking.sandbox_label,
+                offeredAccountId=PERSONA.banking.label,
                 nexusBankAccountId=PERSONA.nexus.bank_label
             ),
             auth=PERSONA.nexus.auth
@@ -302,12 +302,7 @@ def test_double_connection_name():
                 name=PERSONA.nexus.bank_connection,
                 source="new",
                 type="ebics",
-                data=dict(
-                    ebicsURL=PERSONA.banking.ebics.service_url,
-                    hostID=PERSONA.banking.ebics.host,
-                    partnerID=PERSONA.banking.ebics.partner,
-                    userID=PERSONA.banking.ebics.user
-                ),
+                data=PERSONA.ebics.get_as_dict(with_url=True),
             ),
             auth=PERSONA.nexus.auth
         ),
diff --git a/integration-tests/util.py b/integration-tests/util.py
index 5b16e5c..bba34df 100644
--- a/integration-tests/util.py
+++ b/integration-tests/util.py
@@ -11,13 +11,15 @@ import sys
 import os
 
 class EbicsDetails:
-    def get_as_dict(self):
-        return dict(
-            ebicsURL=self.service_url,
+    def get_as_dict(self, with_url):
+        ret = dict(
             hostID=self.host,
             partnerID=self.partner,
             userID=self.user
         )
+        if with_url:
+            ret.update(ebicsURL=self.service_url)
+        return ret
 
     def __init__(self, service_url):
         self.service_url = service_url 
@@ -190,6 +192,7 @@ def startNexus(dbConnString):
         break
     return nexus
 
-def assertResponse(response, acceptedResponses=[200]):
-    assert response.status_code in acceptedResponses
-    return response
+def assertResponse(r, acceptedResponses=[200]):
+    assert r.status_code in acceptedResponses, \
+        f"Unexpected status code (r.status_code) from: {r.request.method} 
{r.url}"
+    return r

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