generated from phoughton/python_package_template
-
Notifications
You must be signed in to change notification settings - Fork 2
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
5 changed files
with
61 additions
and
5 deletions.
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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from pyiso20022.tools.camt053_to_excel import camt053_to_excel | ||
from pyiso20022.tools.camt053_extract import camt053_to_excel | ||
from pyiso20022.tools.camt053_extract import camt053_to_df | ||
|
||
__all__ = [camt053_to_excel] | ||
__all__ = [camt053_to_excel, camt053_to_df] |
File renamed without changes.
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,34 @@ | ||
import pytest | ||
from pyiso20022.tools.camt053_extract import * | ||
import tempfile | ||
import pandas as pd | ||
|
||
|
||
@pytest.mark.parametrize("entry_reference, msg_id", [ | ||
("52198301", "20230928LTERMID100000312221631FT01") | ||
]) | ||
def test_pandas_df_camt053_001_02(entry_reference, msg_id): | ||
|
||
df = camt053_to_df("example_files/gs_camt/camt053_001_02.xml") | ||
|
||
result = df[df['Entry Reference'] == entry_reference]["Message Identification"] | ||
|
||
assert result.values[0] == msg_id | ||
|
||
|
||
@pytest.mark.parametrize("entry_reference, msg_id", [ | ||
("52198301", "20230928LTERMID100000312221631FT01") | ||
]) | ||
def test_excel_camt053_001_02(entry_reference, msg_id): | ||
|
||
tmp_file = tempfile.NamedTemporaryFile(suffix=".xlsx") | ||
tmp_file_name = tmp_file.name | ||
|
||
camt053_to_excel("example_files/gs_camt/camt053_001_02.xml", tmp_file_name) | ||
|
||
df = pd.read_excel(tmp_file_name, sheet_name='Sheet1') | ||
|
||
tmp_file.close() | ||
|
||
result = df[df['Entry Reference'].astype(str) == str(entry_reference)]["Message Identification"] | ||
assert result.values[0] == msg_id |