Beispiel #1
0
 def test_get_random_server(self, mock_choice):
     basic = utils.CinderBasic(self._get_context())
     server_id = mock_choice(basic.context["tenant"]["servers"])
     return_server = basic.get_random_server()
     basic.clients("nova").servers.get.assert_called_once_with(server_id)
     self.assertEqual(basic.clients("nova").servers.get.return_value,
                      return_server)
Beispiel #2
0
 def _update_volume_resource(self, resource):
     cinder_service = cinder_utils.CinderBasic(self.context)
     return cinder_service.cinder.get_volume(resource.id)