-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for viainvest #457
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cadd453
Add support for viainvest
AlexanderLill edb1949
Improve consistency of regex creation
AlexanderLill 28e281a
Reduce value parsing complexity
AlexanderLill 6daa960
Fix formatting
AlexanderLill 9556aa2
Add docstring for _parse_value
AlexanderLill eb902bc
Reduce complexity of _parse_value
AlexanderLill 78964c8
Explicitly add implicit use of mintos test data
AlexanderLill 0a243c3
Fix order of expected transactions
AlexanderLill 268ebf1
Move value parse test into right directory
AlexanderLill b2c0ef7
Add missing param to docstring
AlexanderLill 3702e69
Update src/test/test_statement.py
ChrisRBe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
type_regex: !!map | ||
deposit: "(Amount of funds deposited)" | ||
withdraw: "" | ||
interest: "(Amount of interest payment received)" | ||
ignorable_entry: "(Amount invested in loan)|(Amount of principal repayment received)" | ||
|
||
csv_fieldnames: | ||
booking_date: 'Value date' | ||
booking_date_format: '%m/%d/%Y' | ||
booking_details: 'Loan ID' | ||
booking_id: 'Loan ID' | ||
booking_type: 'Transaction type' | ||
booking_value: 'Credit (€)' |
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Unit test for the p2p statement class | ||
|
||
Copyright 2021-12-12 AlexanderLill | ||
""" | ||
import unittest | ||
|
||
from Statement import Statement | ||
ChrisRBe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
class TestStatement(unittest.TestCase): | ||
"""Test case implementation for Statement""" | ||
|
||
def test_value_parsing(self): | ||
"""test parsing of amount value""" | ||
|
||
test_data = [ | ||
("1.2", 1.2), | ||
("1,1", 1.1), | ||
("1.000,30", 1000.3), | ||
("1,000.30", 1000.3), | ||
("1000.30", 1000.3), | ||
] | ||
|
||
for item in test_data: | ||
test_input = item[0] | ||
expected_output = item[1] | ||
self.assertEqual(expected_output, Statement._parse_value(test_input)) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
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,7 @@ | ||
Transaction date;Value date;Transaction type;Country;Loan ID;Loan Type;Credit (€);Debit (€) | ||
12/13/2020;12/13/2020;Amount of funds deposited;;;;1.000,00; | ||
12/13/2020;12/13/2020;Amount invested in loan;PL;05-3248349;Short-term loan;;10,00 | ||
12/14/2020;12/14/2020;Amount of principal repayment received;LV;04-1246342;Credit line;0,24; | ||
12/14/2020;12/14/2020;Amount of interest payment received;LV;04-1246342;Credit line;0,10; | ||
12/14/2020;12/14/2020;Amount of principal repayment received;PL;05-3233341;Short-term loan;10,00; | ||
12/14/2020;12/14/2020;Amount of interest payment received;PL;05-3233341;Short-term loan;0,09; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc string missing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thank you. Almost perfect :). The value param description is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! Too bad that black does not check for this. I also found nothing in the documentation about adding this check :(