File diff c3c19b0ad21c → 547ae657808f
tests/test_meta_taxImplication.py
Show inline comments
...
 
@@ -54,7 +54,7 @@ def test_valid_values_on_postings(src_value, set_value):
 
        ('Assets:Cash', -25, {'taxImplication': src_value}),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    errors = checker.run(txn, txn.postings[-1])
 
    errors = checker.run(txn, txn.postings[-1], -1)
 
    assert not errors
 
    assert txn.postings[-1].meta.get('taxImplication') == set_value
 

	
...
 
@@ -65,7 +65,7 @@ def test_invalid_values_on_postings(src_value):
 
        ('Assets:Cash', -25, {'taxImplication': src_value}),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    errors = checker.run(txn, txn.postings[-1])
 
    errors = checker.run(txn, txn.postings[-1], -1)
 
    assert errors
 

	
 
@pytest.mark.parametrize('src_value,set_value', VALID_VALUES.items())
...
 
@@ -75,7 +75,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])
 
    errors = checker.run(txn, txn.postings[-1], -1)
 
    assert not errors
 
    assert txn.postings[-1].meta.get('taxImplication') == set_value
 

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

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

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

	
...
 
@@ -126,5 +126,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])
 
    errors = checker.run(txn, txn.postings[-1], -1)
 
    assert bool(errors) == bool(need_value)