|
|
|
@ -154,6 +154,20 @@ def test_partial_context_resolves_december_rows_to_the_previous_year_after_janua |
|
|
|
assert rows[0].posting_date == '2025-12-31' |
|
|
|
assert rows[0].posting_date == '2025-12-31' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('creation', ['20/01/0001', '15/11/0001']) |
|
|
|
|
|
|
|
def test_partial_context_rejects_derived_interval_year_underflow(creation): |
|
|
|
|
|
|
|
data = ('\n' * 20 + f'Data de emissão: {creation}\n').encode() |
|
|
|
|
|
|
|
with pytest.raises(ParseError, match='^INVALID_CREATION_DATE$'): |
|
|
|
|
|
|
|
partial_context_from_creation_line(data) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_partial_context_accepts_year_one_when_derived_bounds_are_representable(): |
|
|
|
|
|
|
|
data = ('\n' * 20 + 'Data de emissão: 15/12/0001\n').encode() |
|
|
|
|
|
|
|
assert partial_context_from_creation_line(data) == { |
|
|
|
|
|
|
|
'start_date': '0001-01-01', 'end_date': '0001-12-31', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('filename,profile,amounts', [ |
|
|
|
@pytest.mark.parametrize('filename,profile,amounts', [ |
|
|
|
('bank.csv', 'BANK_CSV_V1', ['-12.34','100.00']), |
|
|
|
('bank.csv', 'BANK_CSV_V1', ['-12.34','100.00']), |
|
|
|
('full.txt', 'OUROCARD_FULL_V1', ['-12.34','8.11','33.00']), |
|
|
|
('full.txt', 'OUROCARD_FULL_V1', ['-12.34','8.11','33.00']), |
|
|
|
|