gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: reduce code


From: gnunet
Subject: [libeufin] branch master updated: reduce code
Date: Tue, 08 Sep 2020 14:16:37 +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 0c32084  reduce code
0c32084 is described below

commit 0c3208483bf2d8984ef20f2fc416ef31865197a6
Author: MS <ms@taler.net>
AuthorDate: Tue Sep 8 14:16:26 2020 +0200

    reduce code
---
 integration-tests/start-testenv.py                        | 14 +-------------
 integration-tests/test-bankAccount.py                     | 14 +-------------
 integration-tests/test-bankConnection.py                  | 14 +-------------
 integration-tests/test-ebics-backup.py                    | 12 +-----------
 integration-tests/test-ebics-double-payment-submission.py |  9 +--------
 integration-tests/test-ebics-highlevel.py                 | 14 +-------------
 integration-tests/test-ebics.py                           | 13 +------------
 integration-tests/test-sandbox.py                         | 12 +-----------
 integration-tests/test-taler-facade.py                    | 12 +-----------
 integration-tests/util.py                                 |  7 +++++++
 10 files changed, 16 insertions(+), 105 deletions(-)

diff --git a/integration-tests/start-testenv.py 
b/integration-tests/start-testenv.py
index 9556946..1fde4ee 100755
--- a/integration-tests/start-testenv.py
+++ b/integration-tests/start-testenv.py
@@ -7,7 +7,7 @@ import os
 import socket
 import hashlib
 import base64
-from util import startNexus, startSandbox
+from util import startNexus, startSandbox, assertResponse
 
 # Nexus user details
 USERNAME = "person"
@@ -92,18 +92,6 @@ def fail(msg):
     print(msg)
     exit(1)
 
-
-def assertResponse(response):
-    if response.status_code != 200:
-        print("Test failed on URL: {}".format(response.url))
-        # stdout/stderr from both services is A LOT of text.
-        # Confusing to dump all that to console.
-        print("Check nexus.log and sandbox.log, probably under /tmp")
-        exit(1)
-    # Allows for finer grained checks.
-    return response
-
-
 startNexus("nexus-testenv.sqlite3")
 startSandbox()
 
diff --git a/integration-tests/test-bankAccount.py 
b/integration-tests/test-bankAccount.py
index 6045f3d..a640aa8 100755
--- a/integration-tests/test-bankAccount.py
+++ b/integration-tests/test-bankAccount.py
@@ -6,7 +6,7 @@ import os
 import hashlib
 import base64
 
-from util import startNexus, startSandbox
+from util import startNexus, startSandbox, assertResponse
 
 # Nexus user details
 USERNAME = "person"
@@ -41,18 +41,6 @@ def fail(msg):
     print(msg)
     exit(1)
 
-
-def assertResponse(response):
-    if response.status_code != 200:
-        print("Test failed on URL: {}".format(response.url))
-        # stdout/stderr from both services is A LOT of text.
-        # Confusing to dump all that to console.
-        print("Check nexus.log and sandbox.log, probably under /tmp")
-        exit(1)
-    # Allows for finer grained checks.
-    return response
-
-
 startNexus(NEXUS_DB)
 startSandbox()
 
diff --git a/integration-tests/test-bankConnection.py 
b/integration-tests/test-bankConnection.py
index c1bd264..02571a5 100755
--- a/integration-tests/test-bankConnection.py
+++ b/integration-tests/test-bankConnection.py
@@ -6,7 +6,7 @@ import os
 import hashlib
 import base64
 
-from util import startNexus, startSandbox
+from util import startNexus, startSandbox, assertResponse
 
 # Nexus user details
 USERNAME = "person"
@@ -41,18 +41,6 @@ def fail(msg):
     print(msg)
     exit(1)
 
-
-def assertResponse(response):
-    if response.status_code != 200:
-        print("Test failed on URL: {}".format(response.url))
-        # stdout/stderr from both services is A LOT of text.
-        # Confusing to dump all that to console.
-        print("Check nexus.log and sandbox.log, probably under /tmp")
-        exit(1)
-    # Allows for finer grained checks.
-    return response
-
-
 startNexus(NEXUS_DB)
 startSandbox()
 
diff --git a/integration-tests/test-ebics-backup.py 
b/integration-tests/test-ebics-backup.py
index d6bbcf2..9b09db1 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 T, CheckJsonField 
as F
+from util import startNexus, startSandbox, CheckJsonTop as T, CheckJsonField 
as F, assertResponse
 
 # Steps implemented in this test.
 #
@@ -56,16 +56,6 @@ def fail(msg):
     print(msg)
     exit(1)
 
-def assertResponse(response):
-    if response.status_code != 200:
-        print("Test failed on URL: {}".format(response.url))
-        # stdout/stderr from both services is A LOT of text.
-        # Confusing to dump all that to console.
-        print("Check nexus.log and sandbox.log, probably under /tmp")
-        exit(1)
-    # Allows for finer grained checks.
-    return response
-
 startNexus(NEXUS_DB)
 startSandbox()
 
diff --git a/integration-tests/test-ebics-double-payment-submission.py 
b/integration-tests/test-ebics-double-payment-submission.py
index 32493a2..ccaf8c8 100755
--- a/integration-tests/test-ebics-double-payment-submission.py
+++ b/integration-tests/test-ebics-double-payment-submission.py
@@ -7,7 +7,7 @@ import os
 import hashlib
 import base64
 
-from util import startNexus, startSandbox
+from util import startNexus, startSandbox, assertResponse
 
 # Nexus user details
 USERNAME = "person"
@@ -43,13 +43,6 @@ def fail(msg):
     exit(1)
 
 
-def assertResponse(response, acceptedResponses=[200]):
-    if response.status_code not in acceptedResponses:
-        print("Test failed on URL: {}, status: {}/{}".format(
-            response.url, response.status_code, acceptedResponses))
-        exit(1)
-    return response
-
 startNexus(NEXUS_DB)
 startSandbox()
 
diff --git a/integration-tests/test-ebics-highlevel.py 
b/integration-tests/test-ebics-highlevel.py
index da4306c..4d4f293 100755
--- a/integration-tests/test-ebics-highlevel.py
+++ b/integration-tests/test-ebics-highlevel.py
@@ -6,7 +6,7 @@ import os
 import hashlib
 import base64
 
-from util import startNexus, startSandbox
+from util import startNexus, startSandbox, assertResponse
 
 # Steps implemented in this test.
 #
@@ -66,18 +66,6 @@ def fail(msg):
     print(msg)
     exit(1)
 
-
-def assertResponse(response):
-    if response.status_code != 200:
-        print("Test failed on URL: {}".format(response.url))
-        # stdout/stderr from both services is A LOT of text.
-        # Confusing to dump all that to console.
-        print("Check nexus.log and sandbox.log, probably under /tmp")
-        exit(1)
-    # Allows for finer grained checks.
-    return response
-
-
 startNexus(NEXUS_DB)
 startSandbox()
 
diff --git a/integration-tests/test-ebics.py b/integration-tests/test-ebics.py
index 5b5c256..aac20d7 100755
--- a/integration-tests/test-ebics.py
+++ b/integration-tests/test-ebics.py
@@ -8,7 +8,7 @@ import socket
 import hashlib
 import base64
 
-from util import startNexus, startSandbox
+from util import startNexus, startSandbox, assertResponse
 
 # Steps implemented in this test.
 #
@@ -67,20 +67,9 @@ def fail(msg):
     print(msg)
     exit(1)
 
-def assertResponse(response):
-    if response.status_code != 200:
-        print("Test failed on URL: {}".format(response.url))
-        # stdout/stderr from both services is A LOT of text.
-        # Confusing to dump all that to console.
-        print("Check nexus.log and sandbox.log, probably under /tmp")
-        exit(1)
-    # Allows for finer grained checks.
-    return response
-
 startSandbox()
 startNexus(NEXUS_DB)
 
-
 # 0.a
 assertResponse(
     post(
diff --git a/integration-tests/test-sandbox.py 
b/integration-tests/test-sandbox.py
index fd6a1f3..cbb4495 100755
--- a/integration-tests/test-sandbox.py
+++ b/integration-tests/test-sandbox.py
@@ -8,7 +8,7 @@ import socket
 import hashlib
 import base64
 
-from util import startSandbox
+from util import startSandbox, assertResponse
 
 # EBICS details
 EBICS_URL = "http://localhost:5000/ebicsweb";
@@ -28,16 +28,6 @@ def fail(msg):
     print(msg)
     exit(1)
 
-def assertResponse(response):
-    if response.status_code != 200:
-        print("Test failed on URL: {}".format(response.url))
-        # stdout/stderr from both services is A LOT of text.
-        # Confusing to dump all that to console.
-        print("Status code was: " + str(response.status_code))
-        exit(1)
-    # Allows for finer grained checks.
-    return response
-
 startSandbox()
 
 # Create a Ebics host.
diff --git a/integration-tests/test-taler-facade.py 
b/integration-tests/test-taler-facade.py
index 97e5019..0c1052b 100755
--- a/integration-tests/test-taler-facade.py
+++ b/integration-tests/test-taler-facade.py
@@ -8,7 +8,7 @@ import socket
 import hashlib
 import base64
 
-from util import startNexus, startSandbox
+from util import startNexus, startSandbox, assertResponse
 
 # Nexus user details
 USERNAME = "person"
@@ -44,16 +44,6 @@ def fail(msg):
     print(msg)
     exit(1)
 
-def assertResponse(response):
-    if response.status_code != 200:
-        print("Test failed on URL: {}".format(response.url))
-        # stdout/stderr from both services is A LOT of text.
-        # Confusing to dump all that to console.
-        print("Check nexus.log and sandbox.log, probably under /tmp")
-        exit(1)
-    # Allows for finer grained checks.
-    return response
-
 startNexus(NEXUS_DB)
 startSandbox(SANDBOX_DB)
 
diff --git a/integration-tests/util.py b/integration-tests/util.py
index c0e5ab4..42ec249 100644
--- a/integration-tests/util.py
+++ b/integration-tests/util.py
@@ -116,3 +116,10 @@ def startNexus(dbname="nexus-test.sqlite3"):
             continue
         break
     return nexus
+
+def assertResponse(response, acceptedResponses=[200]):
+    if response.status_code not in acceptedResponses:
+        print("Test failed on URL: {}, status: {}".format(
+            response.url, response.status_code))
+        exit(1)
+    return response

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