diff --git a/tests/test_meta_expense_allocation.py b/tests/test_meta_expense_allocation.py index f1e1a9dd4dd094d067a28f5b920271205ccf02d1..5995cdbef8fe312ee68378b9302f363779d304d8 100644 --- a/tests/test_meta_expense_allocation.py +++ b/tests/test_meta_expense_allocation.py @@ -44,7 +44,7 @@ def test_valid_values_on_postings(src_value, set_value): ('Expenses:General', 25, {TEST_KEY: src_value}), ]) checker = meta_expense_allocation.MetaExpenseAllocation() - errors = checker.run(txn, txn.postings[-1], -1) + errors = list(checker.run(txn)) assert not errors assert txn.postings[-1].meta.get(TEST_KEY) == set_value @@ -55,7 +55,7 @@ def test_invalid_values_on_postings(src_value): ('Expenses:General', 25, {TEST_KEY: src_value}), ]) checker = meta_expense_allocation.MetaExpenseAllocation() - errors = checker.run(txn, txn.postings[-1], -1) + errors = list(checker.run(txn)) assert errors @pytest.mark.parametrize('src_value,set_value', VALID_VALUES.items()) @@ -65,7 +65,7 @@ def test_valid_values_on_transactions(src_value, set_value): ('Expenses:General', 25), ]) checker = meta_expense_allocation.MetaExpenseAllocation() - errors = checker.run(txn, txn.postings[-1], -1) + errors = list(checker.run(txn)) assert not errors assert txn.postings[-1].meta.get(TEST_KEY) == set_value @@ -76,7 +76,7 @@ def test_invalid_values_on_transactions(src_value): ('Expenses:General', 25), ]) checker = meta_expense_allocation.MetaExpenseAllocation() - errors = checker.run(txn, txn.postings[-1], -1) + errors = list(checker.run(txn)) assert errors @pytest.mark.parametrize('account', [ @@ -92,7 +92,7 @@ def test_non_expense_accounts_skipped(account): ('Expenses:General', 25, {TEST_KEY: 'program'}), ]) checker = meta_expense_allocation.MetaExpenseAllocation() - errors = checker.run(txn, txn.postings[0], 0) + errors = list(checker.run(txn)) assert not errors @pytest.mark.parametrize('account,set_value', [ @@ -108,7 +108,7 @@ def test_default_values(account, set_value): (account, 25), ]) checker = meta_expense_allocation.MetaExpenseAllocation() - errors = checker.run(txn, txn.postings[-1], -1) + errors = list(checker.run(txn)) assert not errors assert txn.postings[-1].meta[TEST_KEY] == set_value @@ -125,7 +125,7 @@ def test_default_value_set_in_date_range(date, set_value): ('Expenses:General', 25), ]) checker = meta_expense_allocation.MetaExpenseAllocation() - errors = checker.run(txn, txn.postings[-1], -1) + errors = list(checker.run(txn)) assert not errors got_value = (txn.postings[-1].meta or {}).get(TEST_KEY) assert bool(got_value) == bool(set_value)