diff options
author | John <john.garbutt@stackhpc.com> | 2019-05-05 15:27:46 +0100 |
---|---|---|
committer | John Garbutt <john@johngarbutt.com> | 2019-06-03 16:44:50 +0100 |
commit | 06c0fd4fd2f1616d9b36c9d6fa934f3a45527ed7 (patch) | |
tree | 1a58ba61f91871f6e3efc8416b25773d030058be /nova/tests/unit/test_context.py | |
parent | 1459e8edb9681537b263bd6fccfb7b9cbe12d923 (diff) | |
download | nova-06c0fd4fd2f1616d9b36c9d6fa934f3a45527ed7.tar.gz |
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
Diffstat (limited to 'nova/tests/unit/test_context.py')
-rw-r--r-- | nova/tests/unit/test_context.py | 3 |
1 files changed, 1 insertions, 2 deletions
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): |