gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: fix nested checks


From: gnunet
Subject: [libeufin] branch master updated: fix nested checks
Date: Fri, 04 Sep 2020 18:44:36 +0200

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new c93a9c8  fix nested checks
c93a9c8 is described below

commit c93a9c8d2de4507e9e5410d77a8c2e031b2830bc
Author: MS <ms@taler.net>
AuthorDate: Fri Sep 4 18:44:32 2020 +0200

    fix nested checks
---
 integration-tests/test-ebics-backup.py | 15 +++++++++++----
 integration-tests/util.py              |  6 +++---
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/integration-tests/test-ebics-backup.py 
b/integration-tests/test-ebics-backup.py
index 1a5c9ee..d6bbcf2 100755
--- a/integration-tests/test-ebics-backup.py
+++ b/integration-tests/test-ebics-backup.py
@@ -8,7 +8,7 @@ import socket
 import hashlib
 import base64
 
-from util import startNexus, startSandbox, CheckJsonTop as V, CheckJsonField 
as F
+from util import startNexus, startSandbox, CheckJsonTop as T, CheckJsonField 
as F
 
 # Steps implemented in this test.
 #
@@ -104,7 +104,7 @@ assertResponse(
     post(
         "http://localhost:5001/users";,
         headers=dict(Authorization=ADMIN_AUTHORIZATION_HEADER),
-        json=V(F("username"), F("password")).check(
+        json=T(F("username"), F("password")).check(
            dict(username=USERNAME, password=PASSWORD)),
     )
 )
@@ -112,17 +112,24 @@ assertResponse(
 print("creating bank connection")
 
 # 1.b, make a ebics bank connection for the new user.
+check_bankConnection_request = T(
+    F("source"),
+    F("name"),
+    F("data", T(
+        F("ebicsURL"), F("hostID"), F("partnerID"), F("userID")
+    ))
+)
 assertResponse(
     post(
         "http://localhost:5001/bank-connections";,
-        json=dict(
+        json=check_bankConnection_request.check(dict(
             name="my-ebics",
             source="new",
             type="ebics",
             data=dict(
                 ebicsURL=EBICS_URL, hostID=HOST_ID, partnerID=PARTNER_ID, 
userID=USER_ID
             ),
-        ),
+        )),
         headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
     )
 )
diff --git a/integration-tests/util.py b/integration-tests/util.py
index 90a0bf0..c0e5ab4 100644
--- a/integration-tests/util.py
+++ b/integration-tests/util.py
@@ -9,7 +9,7 @@ from pathlib import Path
 import sys
 
 class CheckJsonField:
-    def __init__(self, name, nested = []):
+    def __init__(self, name, nested = None):
         self.name = name
         self.nested = nested
 
@@ -17,8 +17,8 @@ class CheckJsonField:
         if self.name not in json:
             print(f"'{self.name}' not found in the JSON.")
             sys.exit(1)
-        for nested_check in self.nested:
-            self.nested_check.check(json.get(self.name))
+        if self.nested:
+            self.nested.check(json.get(self.name))
 
 class CheckJsonTop:
     def __init__(self, *args):

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