summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-09-03 11:41:42 +0200
committerMS <ms@taler.net>2020-09-03 11:41:42 +0200
commita6375e5da848323ad0b04d608b0b124c282ea4e1 (patch)
tree3c6bb28d48f1a31092888b42e37a4f2721a3bb1b
parentf5e1649daa2e8470babcc2d8188b8ffae0f09d1e (diff)
downloadlibeufin-a6375e5da848323ad0b04d608b0b124c282ea4e1.tar.gz
libeufin-a6375e5da848323ad0b04d608b0b124c282ea4e1.tar.bz2
libeufin-a6375e5da848323ad0b04d608b0b124c282ea4e1.zip
import JSON minimal check library
-rwxr-xr-xintegration-tests/all.sh2
-rw-r--r--integration-tests/util.py19
2 files changed, 21 insertions, 0 deletions
diff --git a/integration-tests/all.sh b/integration-tests/all.sh
index d4911cdb..6bbb7ae6 100755
--- a/integration-tests/all.sh
+++ b/integration-tests/all.sh
@@ -1,5 +1,7 @@
#!/usr/bin/bash
+set -e
+
./test-ebics-backup.py
./test-ebics-highlevel.py
./test-ebics.py
diff --git a/integration-tests/util.py b/integration-tests/util.py
index ab38ea5b..fa933e63 100644
--- a/integration-tests/util.py
+++ b/integration-tests/util.py
@@ -8,6 +8,25 @@ import atexit
from pathlib import Path
import sys
+class CheckJsonField:
+ def __init__(self, name, nested = []):
+ self.name = name
+ self.nested = nested
+
+ def check(self, json):
+ 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))
+
+class CheckJsonTop:
+ def __init__(self, *args):
+ self.checks = args
+
+ def check(self, json):
+ for check in self.checks:
+ check.check(json)
def checkPort(port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)