From 06c0fd4fd2f1616d9b36c9d6fa934f3a45527ed7 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 5 May 2019 15:27:46 +0100 Subject: Move default policy target Move default target from context.can() into policy.authorize() so it is easier to unit test the context behaviour. This was not done originally due to this meaning placement avoided the strange default target, but that is no longer required. Change-Id: I23c433dcd459e7f930ac2eb8a3583c857836cae2 --- nova/tests/unit/test_context.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nova/tests/unit/test_context.py') diff --git a/nova/tests/unit/test_context.py b/nova/tests/unit/test_context.py index c640477ab8..3fde2cb5c3 100644 --- a/nova/tests/unit/test_context.py +++ b/nova/tests/unit/test_context.py @@ -216,8 +216,7 @@ class ContextTestCase(test.NoDBTestCase): self.assertTrue(result) mock_authorize.assert_called_once_with( - ctxt, mock.sentinel.rule, - {'project_id': ctxt.project_id, 'user_id': ctxt.user_id}) + ctxt, mock.sentinel.rule, None) @mock.patch.object(context.policy, 'authorize') def test_can_fatal(self, mock_authorize): -- cgit v1.2.1