@@ -25,28 +25,28 @@ def hook_names(hooks, key):
def test_default_registrations():
hooks = plugin.HOOK_REGISTRY.group_by_directive()
post_hook_names = hook_names(hooks, 'Posting')
assert len(post_hook_names) >= 2
assert 'MetaExpenseAllocation' in post_hook_names
assert 'MetaTaxImplication' in post_hook_names
txn_hook_names = hook_names(hooks, 'Transaction')
assert len(txn_hook_names) >= 2
assert 'MetaExpenseAllocation' in txn_hook_names
assert 'MetaTaxImplication' in txn_hook_names
def test_exclude_single():
hooks = plugin.HOOK_REGISTRY.group_by_directive('-expense-allocation')
assert post_hook_names
assert 'MetaExpenseAllocation' not in post_hook_names
assert txn_hook_names
assert 'MetaExpenseAllocation' not in txn_hook_names
def test_exclude_group_then_include_single():
hooks = plugin.HOOK_REGISTRY.group_by_directive('-metadata expense-allocation')
assert 'MetaTaxImplication' not in post_hook_names
assert 'MetaTaxImplication' not in txn_hook_names
def test_include_group_then_exclude_single():
hooks = plugin.HOOK_REGISTRY.group_by_directive('metadata -tax-implication')
def test_unknown_group_name():
with pytest.raises(ValueError):