summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-12-07 16:47:47 +0100
committerMS <ms@taler.net>2020-12-07 16:47:47 +0100
commite7092cc3a09e649181cc631a06133530e22f0afa (patch)
tree96b98407592943dfd5ba918402be93baefecf120
parent3b82538a81bc0b95108ee5b8e34f87549bedf313 (diff)
downloadlibeufin-tests-e7092cc3a09e649181cc631a06133530e22f0afa.tar.gz
libeufin-tests-e7092cc3a09e649181cc631a06133530e22f0afa.tar.bz2
libeufin-tests-e7092cc3a09e649181cc631a06133530e22f0afa.zip
comments
-rwxr-xr-xchecks.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/checks.py b/checks.py
index 7c99718..2fa3481 100755
--- a/checks.py
+++ b/checks.py
@@ -34,10 +34,13 @@ def assert_json_equal(json1, json2):
assert len(diff.keys()) == 0
def test_camt53_example1():
- # This document has non-singleton money movements.
+ # This document has non-singleton money movements. It is then
+ # not acceptable by the Nexus parser.
parsed = call_parser("./samples/camt53_example1.xml")
entries = parsed["reports"][0]["entries"]
assert(len(entries) == 2)
+ # This check ensures that the non-singleton money movements didn't
+ # end in the ingested Camt report.
assert(len(entries[0]["batches"][0]["batchTransactions"]) == 0)
# Although this money movement is a singleton, it lacks important
@@ -46,16 +49,23 @@ def test_camt53_example1():
assert(len(entries[1]["batches"][0]["batchTransactions"]) == 1)
def test_camt53_example2():
- # This document is linked to a c54 report.
+ # This document is linked to a c54 report, and it doesn't
+ # mention any money movement. It is then not acceptable by
+ # the Nexus parser.
parsed = call_parser("./samples/camt53_example2.xml")
entries = parsed["reports"][0]["entries"]
assert(len(entries) == 1)
+
+ # This check ensures that *zero* sub-transactions got included
+ # in the parsed report.
assert(len(entries[0]["batches"][0]["batchTransactions"]) == 0)
def test_camt53_example3():
# This document is acceptable.
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)