def test_create_client_by_endpoint(self):
     cfg.CONF.set_default('nova_endpoint',
                          'http://127.0.0.1:8774/v2.1',
                          'nova_client')
     plugin = ServerProtectablePlugin(self._context)
     self.assertEqual('compute',
                      plugin._client(self._context).client.service_type)
     self.assertEqual('http://127.0.0.1:8774/v2.1/abcd',
                      plugin._client(self._context).client.management_url)
Ejemplo n.º 2
0
 def test_create_client_by_catalog(self, mock_generate_session):
     plugin = ServerProtectablePlugin(self._context)
     mock_generate_session.return_value = keystone_session.Session(
         auth=None)
     self.assertEqual('compute',
                      plugin._client(self._context).client.service_type)
     self.assertEqual(
         'http://127.0.0.1:8774/v2.1/abcd',
         plugin._client(self._context).client.endpoint_override)
 def test_create_client_by_catalog(self):
     plugin = ServerProtectablePlugin(self._context)
     self.assertEqual('compute',
                      plugin._client(self._context).client.service_type)
     self.assertEqual('http://127.0.0.1:8774/v2.1/abcd',
                      plugin._client(self._context).client.management_url)