[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 01/03: check parsed with expected JSON
From: |
gnunet |
Subject: |
[libeufin] 01/03: check parsed with expected JSON |
Date: |
Thu, 21 Jan 2021 14:39:08 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
commit a9a89b8c0a70d7476a5c9669cf90cc6fe59a22b2
Author: MS <ms@taler.net>
AuthorDate: Thu Jan 21 14:36:44 2021 +0100
check parsed with expected JSON
---
parsing-tests/checks.py | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/parsing-tests/checks.py b/parsing-tests/checks.py
index 537187d..47e2996 100755
--- a/parsing-tests/checks.py
+++ b/parsing-tests/checks.py
@@ -4,6 +4,7 @@ import os
import sys
import json
from subprocess import Popen, PIPE
+from deepdiff import DeepDiff
# return dict with parse-result.
def call_parser(xml_file):
@@ -30,16 +31,10 @@ def get_json_from_disk(json_file):
def test_dashed_subject():
parsed = call_parser("./samples/camt53_example_dashed_subject.xml")
- entries = parsed["reports"][0]["entries"]
- tx = entries[0]["batches"][0]["batchTransactions"][0]
- assert tx["details"]["unstructuredRemittanceInformation"] ==
"subject-with-dashes"
+ expected =
get_json_from_disk("./samples/camt53_example_dashed_subject.json")
+ assert not DeepDiff(parsed, expected)
def test_camt53_example3():
parsed = call_parser("./samples/camt53_example3.xml")
- entries = parsed["reports"][0]["entries"]
- # The following checks ensure that each money movement is a singleton.
- assert(len(entries) == 4)
- assert(len(entries[0]["batches"][0]["batchTransactions"]) == 1)
- assert(len(entries[1]["batches"][0]["batchTransactions"]) == 1)
- assert(len(entries[2]["batches"][0]["batchTransactions"]) == 1)
- assert(len(entries[3]["batches"][0]["batchTransactions"]) == 1)
+ expected = get_json_from_disk("./samples/camt53_example3.json")
+ assert not DeepDiff(parsed, expected)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.