libeufin

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

commit edc04b5bd08bc8173cfad79ed60f294674ada4aa
parent ce9d8e7d62c6b1ffe5905a44fdf09ca2665c08d3
Author: MS <ms@taler.net>
Date:   Thu,  3 Dec 2020 15:04:22 +0100

Camt testing.

Melt two ingestions into one test function.

Diffstat:
Rintegration-tests/camt53-gls-style.xml -> integration-tests/camt53-gls-style-0.xml | 0
Aintegration-tests/camt53-gls-style-1.xml | 132+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mintegration-tests/tests.py | 17+++++++++++++----
3 files changed, 145 insertions(+), 4 deletions(-)

diff --git a/integration-tests/camt53-gls-style.xml b/integration-tests/camt53-gls-style-0.xml diff --git a/integration-tests/camt53-gls-style-1.xml b/integration-tests/camt53-gls-style-1.xml @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.04" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.053.001.04 camt.053.001.04.xsd"> + <BkToCstmrStmt> + <GrpHdr> + <MsgId>C053201124181701</MsgId> + <CreDtTm>2020-11-24T18:17:26+01:00</CreDtTm> + <MsgRcpt> + <Id> + <OrgId> + <AnyBIC>UBSWCHZHCCS</AnyBIC> + </OrgId> + </Id> + </MsgRcpt> + <MsgPgntn> + <PgNb>1</PgNb> + <LastPgInd>true</LastPgInd> + </MsgPgntn> + <AddtlInf>SPS/1.7</AddtlInf> + </GrpHdr> + <Stmt> + <Id>0002011241817001</Id> + <ElctrncSeqNb>1</ElctrncSeqNb> + <CreDtTm>2020-11-24T18:17:26+01:00</CreDtTm> + <FrToDt> + <FrDtTm>2020-11-24T00:00:00+01:00</FrDtTm> + <ToDtTm>2020-11-24T24:00:00+01:00</ToDtTm> + </FrToDt> + <Acct> + <Id> + <IBAN>CH2801234000123456789</IBAN> + </Id> + <Ccy>CHF</Ccy> + <Ownr> + <Nm>UNIFITS GmbH</Nm> + </Ownr> + <Svcr> + <FinInstnId> + <BICFI>UBSWCHZH80A</BICFI> + <Nm>UBS SWITZERLAND AG</Nm> + <Othr> + <Id>CHE-116.303.292 MWST</Id> + <Issr>VAT-ID</Issr> + </Othr> + </FinInstnId> + </Svcr> + </Acct> + <Bal> + <Tp> + <CdOrPrtry> + <Cd>OPBD</Cd> + </CdOrPrtry> + </Tp> + <Amt Ccy="CHF">10000</Amt> + <CdtDbtInd>CRDT</CdtDbtInd> + <Dt> + <Dt>2020-11-24</Dt> + </Dt> + </Bal> + <Bal> + <Tp> + <CdOrPrtry> + <Cd>CLBD</Cd> + </CdOrPrtry> + </Tp> + <Amt Ccy="CHF">9975.7</Amt> + <CdtDbtInd>CRDT</CdtDbtInd> + <Dt> + <Dt>2020-11-24</Dt> + </Dt> + </Bal> + <Bal> + <Tp> + <CdOrPrtry> + <Cd>CLAV</Cd> + </CdOrPrtry> + </Tp> + <Amt Ccy="CHF">9975.7</Amt> + <CdtDbtInd>CRDT</CdtDbtInd> + <Dt> + <Dt>2020-11-24</Dt> + </Dt> + </Bal> + <Ntry> + <Amt Ccy="CHF">24.3</Amt> + <CdtDbtInd>DBIT</CdtDbtInd> + <Sts>BOOK</Sts> + <BookgDt> + <Dt>2020-11-24</Dt> + </BookgDt> + <ValDt> + <Dt>2020-11-24</Dt> + </ValDt> + <AcctSvcrRef>ACSR201124181701</AcctSvcrRef> + <BkTxCd> + <Domn> + <Cd>PMNT</Cd> + <Fmly> + <Cd>ICDT</Cd> + <SubFmlyCd>DMCT</SubFmlyCd> + </Fmly> + </Domn> + <Prtry> + <Cd>Z24</Cd> + </Prtry> + </BkTxCd> + <AddtlInfInd> + <MsgNmId>camt.054.001.04</MsgNmId> + <MsgId>C054201124181701</MsgId> + </AddtlInfInd> + <AmtDtls> + <InstdAmt> + <Amt Ccy="CHF">24.3</Amt> + </InstdAmt> + <TxAmt> + <Amt Ccy="CHF">24.3</Amt> + </TxAmt> + </AmtDtls> + <NtryDtls> + <Btch> + <MsgId>UXC20112400010</MsgId> + <PmtInfId>UXC20112400010PI00001</PmtInfId> + <NbOfTxs>2</NbOfTxs> + <TtlAmt Ccy="CHF">24.3</TtlAmt> + <CdtDbtInd>DBIT</CdtDbtInd> + </Btch> + </NtryDtls> + <AddtlNtryInf>Order</AddtlNtryInf> + </Ntry> + </Stmt> + </BkToCstmrStmt> +</Document> +\ No newline at end of file diff --git a/integration-tests/tests.py b/integration-tests/tests.py @@ -339,13 +339,22 @@ def test_double_connection_name(): ) def test_ingestion_camt53(): - with open("camt53-gls-style.xml") as f: - camt = f.read() + with open("camt53-gls-style-0.xml") as f: + camt_0 = f.read() assertResponse( post( f"{N}/bank-accounts/{NEXUS_BANK_LABEL}/test-camt-ingestion/C53", auth=NEXUS_AUTH, - data=camt + data=camt_0 + ) + ) + with open("camt53-gls-style-1.xml") as f: + camt_1 = f.read() + assertResponse( + post( + f"{N}/bank-accounts/{NEXUS_BANK_LABEL}/test-camt-ingestion/C53", + auth=NEXUS_AUTH, + data=camt_1 ) ) @@ -356,4 +365,4 @@ def test_ingestion_camt53(): ) ) - assert(len(resp.json()["transactions"]) == 4) + assert(len(resp.json()["transactions"]) == 5)