forked from gaugendre/ofx-processor
Add more tests
This commit is contained in:
parent
e15c452367
commit
bd5e7dddec
2 changed files with 20 additions and 0 deletions
|
@ -46,6 +46,16 @@ class LclLineTestCase(unittest.TestCase):
|
|||
result_date = LclLine(transaction).get_date()
|
||||
self.assertEqual(result_date, expected_date)
|
||||
|
||||
def test_get_date_with_transaction_name_wrong_date(self):
|
||||
transaction = OfxTransaction(
|
||||
dtposted=datetime.datetime(2020, 1, 23, 1, 2, 3),
|
||||
name=" CB IKEA 25/25/25",
|
||||
)
|
||||
expected_date = "2020-01-23"
|
||||
|
||||
result_date = LclLine(transaction).get_date()
|
||||
self.assertEqual(result_date, expected_date)
|
||||
|
||||
def test_get_amount_positive(self):
|
||||
transaction = OfxTransaction(trnamt=52.2)
|
||||
expected_amount = 52200
|
||||
|
|
10
tests/test_ofx_base_line.py
Normal file
10
tests/test_ofx_base_line.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
from ofx_processor.utils.base_ofx import OfxBaseLine
|
||||
from tests.utils import OfxTransaction
|
||||
|
||||
|
||||
def test_name():
|
||||
name = "VIR INST"
|
||||
transaction = OfxTransaction(name=name)
|
||||
|
||||
result_name = OfxBaseLine(transaction).get_payee()
|
||||
assert result_name == name
|
Loading…
Reference in a new issue