generated from phoughton/python_package_template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:remt.001.001.06"> | ||
<RmtAdvc> | ||
<GrpHdr> | ||
<MsgId>20241001Ex1234</MsgId> | ||
<CreDtTm>2024-10-01T09:00:00</CreDtTm> | ||
<InitgPty> | ||
<Id> | ||
<OrgId> | ||
<Othr> | ||
<Id>623456</Id> | ||
<SchmeNm> | ||
<Prtry>Exchange Framework</Prtry> | ||
</SchmeNm> | ||
</Othr> | ||
</OrgId> | ||
</Id> | ||
</InitgPty> | ||
<MsgRcpt> | ||
<Id> | ||
<OrgId> | ||
<Othr> | ||
<Id>654326</Id> | ||
<SchmeNm> | ||
<Prtry>Exchange Framework</Prtry> | ||
</SchmeNm> | ||
</Othr> | ||
</OrgId> | ||
</Id> | ||
</MsgRcpt> | ||
</GrpHdr> | ||
<RmtInf> | ||
<RmtId>20240427_121000322_1754_321</RmtId> | ||
<Strd> | ||
<RfrdDocInf> | ||
<Tp> | ||
<CdOrPrtry> | ||
<Cd>CINV</Cd> | ||
</CdOrPrtry> | ||
</Tp> | ||
<Nb>684528</Nb> | ||
<RltdDt>2022-06-10</RltdDt> | ||
</RfrdDocInf> | ||
<RfrdDocAmt> | ||
<RmtAmtAndTp> | ||
<Amt Ccy="USD">3916.11</Amt> | ||
</RmtAmtAndTp> | ||
</RfrdDocAmt> | ||
</Strd> | ||
<Strd> | ||
<RfrdDocInf> | ||
<Tp> | ||
<CdOrPrtry> | ||
<Cd>CINV</Cd> | ||
</CdOrPrtry> | ||
</Tp> | ||
<Nb>683529</Nb> | ||
<RltdDt>2022-06-10</RltdDt> | ||
</RfrdDocInf> | ||
<RfrdDocAmt> | ||
<RmtAmtAndTp> | ||
<Amt Ccy="USD">3916.99</Amt> | ||
</RmtAmtAndTp> | ||
</RfrdDocAmt> | ||
</Strd> | ||
<OrgnlPmtInf> | ||
<Refs> | ||
<EndToEndId>Linking ID Example 1</EndToEndId> | ||
</Refs> | ||
<PmtTpInf> | ||
<LclInstrm> | ||
<Cd>ARC</Cd> | ||
</LclInstrm> | ||
</PmtTpInf> | ||
<Amt> | ||
<InstdAmt Ccy="USD">7845.61</InstdAmt> | ||
</Amt> | ||
<ReqdExctnDt> | ||
<Dt>2022-07-10</Dt> | ||
</ReqdExctnDt> | ||
<Dbtr> | ||
<Nm>Payer McTest1</Nm> | ||
</Dbtr> | ||
<Cdtr> | ||
<Nm>Payee McTest1</Nm> | ||
</Cdtr> | ||
</OrgnlPmtInf> | ||
</RmtInf> | ||
</RmtAdvc> | ||
</Document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setuptools.setup( | ||
name="pyiso20022", | ||
version="1.4.4", | ||
version="1.4.5", | ||
author="Peter Houghton", | ||
author_email="[email protected]", | ||
description="pyiso20022 is a library for generating ISO20022 messages in Python.", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
from xsdata.formats.dataclass.parsers import XmlParser | ||
from pyiso20022.remt.remt_001_001_06 import * | ||
from decimal import Decimal | ||
|
||
|
||
@pytest.mark.parametrize("expected_RmtAmtAndTp", [ | ||
("3916.11") | ||
]) | ||
def test_parse_remt001_001_006(expected_RmtAmtAndTp): | ||
|
||
parser = XmlParser() | ||
|
||
with open("example_files/remt/remt_001_001_06.xml", "rb") as xml_file: | ||
doc: Document = parser.parse(xml_file, Document, ) | ||
|
||
amount = doc.rmt_advc.rmt_inf[0].strd[0].rfrd_doc_amt.rmt_amt_and_tp[0].amt.value | ||
|
||
assert amount == Decimal(expected_RmtAmtAndTp) |