delete requirements (see requirements.txt) & working script for beancount 2.3.4
This commit is contained in:
20
test_amount_parsing.py
Normal file
20
test_amount_parsing.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import unittest
|
||||
from beancount.core.amount import D
|
||||
|
||||
class TestAmountParsing(unittest.TestCase):
|
||||
|
||||
def clean_bedrag_str(self, bedrag_str):
|
||||
bedrag_str = bedrag_str.replace('.','')
|
||||
bedrag_str = bedrag_str.replace(',', '.')
|
||||
return bedrag_str
|
||||
|
||||
# Europese notatie - het werkt dus prima
|
||||
def test_correct_amount_parsing(self):
|
||||
test_bedrag = "1.699,62"
|
||||
expected_decimal = D("1699.62")
|
||||
cleaned_string = self.clean_bedrag_str(test_bedrag)
|
||||
|
||||
self.assertEqual(D(cleaned_string), expected_decimal)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user