libeufin

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

commit 4a37f9de87c29e20178e989f404469bb7e45719e
parent d03fda89b28811008c78c53de9c2bc919e76009e
Author: MS <ms@taler.net>
Date:   Mon, 14 Dec 2020 23:27:58 +0100

add-incoming passes

Diffstat:
Mintegration-tests/tests.py | 13++++++++++++-
Mintegration-tests/util.py | 7+++++--
2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/integration-tests/tests.py b/integration-tests/tests.py @@ -258,7 +258,18 @@ def test_taler_facade_config(make_taler_facade): ) -def test_taler_facade_history(make_taler_facade): +def test_taler_facade_incoming(make_taler_facade): + assertResponse(post( + f"{PERSONA.nexus.base_url}/facades/{PERSONA.nexus.taler_facade_name}/taler/admin/add-incoming", + json=dict( + amount="EUR:1", + reserve_pub="not ingested for now", + debit_account="payto://iban/THEIBAN/THEBIC?sender-name=TheName" + ), + auth=PERSONA.nexus.auth + )) + +def test_taler_facade_outgoing(make_taler_facade): assertResponse( post( f"{PERSONA.nexus.base_url}/facades/{PERSONA.nexus.taler_facade_name}/taler/transfer", diff --git a/integration-tests/util.py b/integration-tests/util.py @@ -193,6 +193,9 @@ def startNexus(dbConnString): return nexus def assertResponse(r, acceptedResponses=[200]): - assert r.status_code in acceptedResponses, \ - f"Unexpected status code (r.status_code) from: {r.request.method} {r.url}" + def http_trace(r): + request = f"{r.request.method} {r.request.url}\n{r.request.body.decode('utf-8')}" + response = f"{r.status_code} {r.reason}\n{r.text}" + return f"(the following communication failed)\n\n{request}\n\n{response}" + assert r.status_code in acceptedResponses, http_trace(r) return r