test_filters: Test non-string metadata values.

This commit is contained in:
Brett Smith 2020-04-22 10:31:52 -04:00
parent cc03c4beb6
commit 26762e11ef

View file

@ -20,6 +20,8 @@ import pytest
from . import testutil
from datetime import date
from conservancy_beancount import data
from conservancy_beancount import filters
@ -37,6 +39,7 @@ def cc_txn_pair():
**txn_meta,
date=next(dates),
receipt='CCReceipt.pdf',
metadate=next(dates),
postings=[
('Liabilities:CreditCard', -36),
('Expenses:Other', 35),
@ -47,6 +50,7 @@ def cc_txn_pair():
**txn_meta,
date=next(dates),
receipt='CCPayment.pdf',
metadate=next(dates),
postings=[
('Liabilities:CreditCard', 36),
('Assets:Checking', -36, {'statement': 'CheckingStatement.pdf'}),
@ -68,6 +72,8 @@ def check_filter(actual, entries, expected_indexes):
('receipt', 'CCPayment.pdf', range(3, 5)),
('receipt', 'CC', ()),
('statement', 'CheckingStatement.pdf', [4]),
('metadate', date(2020, 9, 2), range(3)),
('metadate', date(2020, 9, 4), range(3, 5)),
('BadKey', '', ()),
('emptykey', '', ()),
])