libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit a6375e5da848323ad0b04d608b0b124c282ea4e1
parent f5e1649daa2e8470babcc2d8188b8ffae0f09d1e
Author: MS <ms@taler.net>
Date:   Thu,  3 Sep 2020 11:41:42 +0200

import JSON minimal check library

Diffstat:
Mintegration-tests/all.sh | 2++
Mintegration-tests/util.py | 19+++++++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)

diff --git 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 @@ -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)