Exemplo n.º 1
0
 def test_check_policy(self, mock_enforce):
     target = {
         'project_id': self.context.project_id,
         'user_id': self.context.user_id,
     }
     api.check_policy(self.context, 'get_all')
     mock_enforce.assert_called_once_with(
         self.context, 'network:get_all', target)
Exemplo n.º 2
0
 def test_check_policy(self):
     self.mox.StubOutWithMock(policy, 'enforce')
     target = {
         'project_id': self.context.project_id,
         'user_id': self.context.user_id,
     }
     policy.enforce(self.context, 'network:get_all', target)
     self.mox.ReplayAll()
     api.check_policy(self.context, 'get_all')
Exemplo n.º 3
0
 def test_check_policy(self):
     self.mox.StubOutWithMock(policy, 'enforce')
     target = {
         'project_id': self.context.project_id,
         'user_id': self.context.user_id,
     }
     policy.enforce(self.context, 'network:get_all', target)
     self.mox.ReplayAll()
     api.check_policy(self.context, 'get_all')
Exemplo n.º 4
0
 def test_check_policy(self):
     self.mox.StubOutWithMock(policy, "enforce")
     target = {"project_id": self.context.project_id, "user_id": self.context.user_id}
     policy.enforce(self.context, "network:get_all", target)
     self.mox.ReplayAll()
     api.check_policy(self.context, "get_all")