def test_check_with_rule(self): self.enforcer.set_rules(dict(default=base.FakeCheck())) result = self.enforcer.enforce('default', 'target', 'creds') self.assertEqual(('target', 'creds', self.enforcer), result)
def test_check_explicit(self): rule = base.FakeCheck() result = self.enforcer.enforce(rule, 'target', 'creds') self.assertEqual(('target', 'creds', self.enforcer), result)