summaryrefslogtreecommitdiff
path: root/oslo_policy/tests/test_policy.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_policy/tests/test_policy.py')
-rw-r--r--oslo_policy/tests/test_policy.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/oslo_policy/tests/test_policy.py b/oslo_policy/tests/test_policy.py
index 0a8bab5..d5c86c3 100644
--- a/oslo_policy/tests/test_policy.py
+++ b/oslo_policy/tests/test_policy.py
@@ -1802,6 +1802,12 @@ class DocumentedRuleDefaultDeprecationTestCase(base.PolicyBaseTestCase):
self.assertEqual(
str(enforcer.rules['foo:create_bar']), str(expected_check))
self.assertEqual(check, rule.check)
+ # Hacky way to check whether _handle_deprecated_rule was called again.
+ # If a second call to load_rules doesn't overwrite our dummy rule then
+ # we know it didn't call the deprecated rule function again.
+ enforcer.rules['foo:create_bar'] = 'foo:bar'
+ enforcer.load_rules()
+ self.assertEqual('foo:bar', enforcer.rules['foo:create_bar'])
class DocumentedRuleDefaultTestCase(base.PolicyBaseTestCase):