libeufin

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

commit be29b5b4861b56e916b8671ee7a62d69c41523c8
parent 3ade91b4426c58703c314d6875d07704e72ec4fe
Author: ms <ms@taler.net>
Date:   Thu, 25 Mar 2021 10:21:31 +0100

Taler tests gone (moved into TypeScript harness)

Diffstat:
Mintegration-tests/tests.py | 139-------------------------------------------------------------------------------
1 file changed, 0 insertions(+), 139 deletions(-)

diff --git a/integration-tests/tests.py b/integration-tests/tests.py @@ -365,25 +365,6 @@ def test_deduplication(make_crdt_payment): assert len(resp.json().get("transactions")) == 1 -@pytest.fixture -def make_taler_facade(): - assertResponse( - post( - f"{user0.nexus.base_url}/facades", - json=dict( - name=user0.nexus.taler_facade_name, - type="taler-wire-gateway", - config=dict( - currency="EUR", - bankAccount=user0.nexus.bank_label, - bankConnection=user0.nexus.bank_connection, - reserveTransferLevel="UNUSED", - ) - ), - auth=user0.nexus.auth - ) - ) - def test_facade_name_collision(): assertResponse( post( @@ -419,126 +400,6 @@ def test_facade_name_collision(): acceptedResponses=[400] ) -def test_taler_facade_config(make_taler_facade): - resp = assertResponse( - get( - f"{user0.nexus.base_url}/facades/{user0.nexus.taler_facade_name}/taler-wire-gateway/config", - auth=user0.nexus.auth - ) - ) - assertJsonEqual( - resp.json(), - dict(currency="EUR", version="0.0.0", name=user0.nexus.taler_facade_name) - ) - - -def test_taler_facade_incoming(make_taler_facade): - resp = assertResponse(post( - f"{user0.nexus.base_url}/facades/{user0.nexus.taler_facade_name}/taler-wire-gateway/admin/add-incoming", - json=dict( - amount="EUR:1", - reserve_pub="1BCZ7KA333E3YJBFWT4J173M3E713YGFFGD856KPSGZN1N8ZKZR0", - debit_account="payto://iban/BUKBGB22/DE00000000000000000000?sender-name=TheName" - ), - auth=user0.nexus.auth - )) - - assertResponse(post( - f"{user0.nexus.base_url}/bank-accounts/{user0.nexus.bank_label}/fetch-transactions", - auth=user0.nexus.auth - )) - - resp = assertResponse(get( - "/".join([ - user0.nexus.base_url, - "facades", - user0.nexus.taler_facade_name, - "taler-wire-gateway/history/incoming?delta=5"]), - auth=user0.nexus.auth - )) - assert len(resp.json().get("incoming_transactions")) == 1 - - -def test_taler_facade_refund(make_taler_facade): - resp = assertResponse(post( - f"{user0.nexus.base_url}/facades/{user0.nexus.taler_facade_name}/taler-wire-gateway/admin/add-incoming", - json=dict( - amount="EUR:1", - reserve_pub="invalid reserve public key", - debit_account="payto://iban/BUKBGB22/DE00000000000000000000?sender-name=TheName" - ), - auth=user0.nexus.auth - )) - - assertResponse(post( - f"{user0.nexus.base_url}/bank-accounts/{user0.nexus.bank_label}/fetch-transactions", - auth=user0.nexus.auth - )) - - assertResponse(post( - f"{user0.nexus.base_url}/bank-accounts/{user0.nexus.bank_label}/submit-all-payment-initiations", - auth=user0.nexus.auth - )) - - # Fetch again the history, so as to find the freshly made refund. - assertResponse(post( - f"{user0.nexus.base_url}/bank-accounts/{user0.nexus.bank_label}/fetch-transactions", - auth=user0.nexus.auth - )) - - resp = assertResponse( - get( - f"{user0.nexus.base_url}/bank-accounts/{user0.nexus.bank_label}/transactions", - auth=user0.nexus.auth - ) - ) - - transactionsList = resp.json().get("transactions") - assert len(transactionsList) == 2 - for transaction in transactionsList: - movement = transaction.get("batches")[0].get("batchTransactions")[0] - subject = movement.get("details").get("unstructuredRemittanceInformation") - if subject.find("Taler refund") == 0 and movement.get("amount") == "EUR:1": - return - assert False, "Refund transaction not found" - - -def test_taler_facade_outgoing(make_taler_facade): - assertResponse( - post( - f"{user0.nexus.base_url}/facades/{user0.nexus.taler_facade_name}/taler-wire-gateway/transfer", - json=dict( - request_uid="0", - amount="EUR:1", - exchange_base_url="http//url", - wtid="nice", - credit_account="payto://iban/AGRIFRPP/FR7630006000011234567890189?receiver-name=theName" - ), - auth=user0.nexus.auth - ) - ) - assertResponse( - post( - f"{user0.nexus.base_url}/bank-accounts/{user0.nexus.bank_label}/payment-initiations/1/submit", - json=dict(), - auth=user0.nexus.auth - ) - ) - assertResponse( - post( - f"{user0.nexus.base_url}/bank-accounts/{user0.nexus.bank_label}/fetch-transactions", - auth=user0.nexus.auth - ) - ) - - resp = assertResponse( - get( - f"{user0.nexus.base_url}/facades/{user0.nexus.taler_facade_name}/taler-wire-gateway/history/outgoing?delta=5", - auth=user0.nexus.auth - ) - ) - assert len(resp.json().get("outgoing_transactions")) == 1 - def test_double_connection_name(): assertResponse( post(