File diff c9ff4ab74617 → a41feb94b3e0
tests/test_meta_tax_implication.py
Show inline comments
...
 
@@ -56,7 +56,7 @@ def test_valid_values_on_postings(src_value, set_value):
 
        ('Assets:Cash', -25, {TEST_KEY: src_value}),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    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
 

	
...
 
@@ -67,7 +67,7 @@ def test_invalid_values_on_postings(src_value):
 
        ('Assets:Cash', -25, {TEST_KEY: src_value}),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    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())
...
 
@@ -77,7 +77,7 @@ def test_valid_values_on_transactions(src_value, set_value):
 
        ('Assets:Cash', -25),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    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
 

	
...
 
@@ -88,7 +88,7 @@ def test_invalid_values_on_transactions(src_value):
 
        ('Assets:Cash', -25),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    errors = checker.run(txn, txn.postings[-1], -1)
 
    errors = list(checker.run(txn))
 
    assert errors
 

	
 
@pytest.mark.parametrize('account', [
...
 
@@ -102,7 +102,7 @@ def test_non_asset_accounts_skipped(account):
 
        ('Assets:Cash', -25, {TEST_KEY: 'USA-Corporation'}),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    errors = checker.run(txn, txn.postings[0], 0)
 
    errors = list(checker.run(txn))
 
    assert not errors
 

	
 
def test_asset_credits_skipped():
...
 
@@ -111,7 +111,7 @@ def test_asset_credits_skipped():
 
        ('Assets:Cash', 25),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    errors = checker.run(txn, txn.postings[-1], -1)
 
    errors = list(checker.run(txn))
 
    assert not errors
 
    assert not txn.postings[-1].meta
 

	
...
 
@@ -128,5 +128,5 @@ def test_default_value_set_in_date_range(date, need_value):
 
        ('Assets:Cash', -25),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    errors = checker.run(txn, txn.postings[-1], -1)
 
    errors = list(checker.run(txn))
 
    assert bool(errors) == bool(need_value)