File diff 26762e11ef6a → 4420873c967e
tests/test_filters.py
Show inline comments
...
 
@@ -81,3 +81,17 @@ def test_filter_meta_equal(cc_txn_pair, key, value, expected_indexes):
 
    postings = data.Posting.from_entries(cc_txn_pair)
 
    actual = filters.filter_meta_equal(postings, key, value)
 
    check_filter(actual, cc_txn_pair, expected_indexes)
 

	
 
@pytest.mark.parametrize('key,regexp,expected_indexes', [
 
    ('entity', '^Smith-', range(5)),
 
    ('receipt', r'\.pdf$', range(5)),
 
    ('receipt', 'Receipt', range(3)),
 
    ('statement', '.', [4]),
 
    ('metadate', 'foo', ()),
 
    ('BadKey', '.', ()),
 
    ('emptykey', '.', ()),
 
])
 
def test_filter_meta_match(cc_txn_pair, key, regexp, expected_indexes):
 
    postings = data.Posting.from_entries(cc_txn_pair)
 
    actual = filters.filter_meta_match(postings, key, regexp)
 
    check_filter(actual, cc_txn_pair, expected_indexes)