Пример #1
0
 def test_keystone(self):
     self.assertTrue("keystone" not in self.clients.cache)
     client = self.clients.keystone()
     self.assertEqual(client, self.fake_keystone)
     endpoint = {"timeout": cfg.CONF.openstack_client_http_timeout,
                 "insecure": False, "cacert": None}
     kwargs = dict(self.endpoint.to_dict().items() + endpoint.items())
     self.mock_create_keystone_client.assert_called_once_with(kwargs)
     self.assertEqual(self.clients.cache["keystone"], self.fake_keystone)
Пример #2
0
 def test_keystone(self):
     with mock.patch("rally.osclients.keystone") as mock_keystone:
         fake_keystone = fakes.FakeKeystoneClient()
         mock_keystone.Client = mock.MagicMock(return_value=fake_keystone)
         self.assertTrue("keystone" not in self.clients.cache)
         client = self.clients.keystone()
         self.assertEqual(client, fake_keystone)
         endpoint = {"timeout": cfg.CONF.openstack_client_http_timeout,
                     "insecure": False, "cacert": None}
         kwargs = dict(self.endpoint.to_dict().items() + endpoint.items())
         mock_keystone.Client.assert_called_once_with(**kwargs)
         self.assertEqual(self.clients.cache["keystone"], fake_keystone)
Пример #3
0
 def test_keystone(self):
     self.assertTrue("keystone" not in self.clients.cache)
     client = self.clients.keystone()
     self.assertEqual(client, self.fake_keystone)
     endpoint = {
         "timeout": cfg.CONF.openstack_client_http_timeout,
         "insecure": False,
         "cacert": None
     }
     kwargs = dict(self.endpoint.to_dict().items() + endpoint.items())
     self.mock_create_keystone_client.assert_called_once_with(kwargs)
     self.assertEqual(self.clients.cache["keystone"], self.fake_keystone)
Пример #4
0
 def test_keystone(self):
     self.assertTrue("keystone" not in self.clients.cache)
     client = self.clients.keystone()
     self.assertEqual(client, self.fake_keystone)
     mgmt_url = urlparse.urlparse(self.endpoint.auth_url)
     auth_url = "{0}://{1}:{2}{3}".format(mgmt_url.scheme,
                                          mgmt_url.hostname,
                                          self.endpoint.admin_port,
                                          mgmt_url.path)
     endpoint = {"timeout": cfg.CONF.openstack_client_http_timeout,
                 "insecure": False, "cacert": None,
                 "endpoint": auth_url}
     kwargs = dict(self.endpoint.to_dict().items() + endpoint.items())
     self.mock_create_keystone_client.assert_called_once_with(kwargs)
     self.assertEqual(self.clients.cache["keystone"], self.fake_keystone)
Пример #5
0
 def test_keystone(self):
     with mock.patch("rally.osclients.keystone") as mock_keystone:
         fake_keystone = fakes.FakeKeystoneClient()
         mock_keystone.Client = mock.MagicMock(return_value=fake_keystone)
         self.assertTrue("keystone" not in self.clients.cache)
         client = self.clients.keystone()
         self.assertEqual(client, fake_keystone)
         endpoint = {
             "timeout": cfg.CONF.openstack_client_http_timeout,
             "insecure": False,
             "cacert": None
         }
         kwargs = dict(self.endpoint.to_dict().items() + endpoint.items())
         mock_keystone.Client.assert_called_once_with(**kwargs)
         self.assertEqual(self.clients.cache["keystone"], fake_keystone)
Пример #6
0
 def test_keystone(self):
     self.assertTrue("keystone" not in self.clients.cache)
     client = self.clients.keystone()
     self.assertEqual(client, self.fake_keystone)
     mgmt_url = urlparse.urlparse(self.endpoint.auth_url)
     auth_url = "{0}://{1}:{2}{3}".format(mgmt_url.scheme,
                                          mgmt_url.hostname,
                                          self.endpoint.admin_port,
                                          mgmt_url.path)
     endpoint = {
         "timeout": cfg.CONF.openstack_client_http_timeout,
         "insecure": False,
         "cacert": None,
         "endpoint": auth_url
     }
     kwargs = dict(self.endpoint.to_dict().items() + endpoint.items())
     self.mock_create_keystone_client.assert_called_once_with(kwargs)
     self.assertEqual(self.clients.cache["keystone"], self.fake_keystone)