Esempio n. 1
0
 def test_keystone_client_instantiation_project_scope(
         self, ks_token, ksclient_session, ksclient_class):
     project_context = context.RequestContext('fake_user',
                                              project_id=fake.PROJECT_ID)
     quota_utils._keystone_client(project_context)
     ks_token.assert_called_once_with(auth_url=self.auth_url,
                                      token=project_context.auth_token,
                                      project_id=project_context.project_id)
Esempio n. 2
0
 def test_keystone_client_instantiation_domain_scope(
         self, ks_token, ksclient_session, ksclient_class):
     domain_context = context.RequestContext('fake_user',
                                             'fake_proj_id',
                                             domain_id='default')
     quota_utils._keystone_client(domain_context)
     ks_token.assert_called_once_with(auth_url=self.auth_url,
                                      token=domain_context.auth_token,
                                      domain_id=domain_context.domain_id)
Esempio n. 3
0
 def test_keystone_client_instantiation_system_scope(
         self, ks_token, ksclient_session, ksclient_class):
     system_context = context.RequestContext('fake_user',
                                             'fake_proj_id',
                                             system_scope='all')
     quota_utils._keystone_client(system_context)
     ks_token.assert_called_once_with(
         auth_url=self.auth_url,
         token=system_context.auth_token,
         system_scope=system_context.system_scope)
Esempio n. 4
0
 def test_keystone_client_instantiation(self, ksclient_session,
                                        ksclient_class):
     quota_utils._keystone_client(self.context)
     ksclient_class.assert_called_once_with(auth_url=self.auth_url,
                                            session=ksclient_session(),
                                            version=(3, 0))
Esempio n. 5
0
 def test_keystone_client_instantiation(self, ksclient_session,
                                        ksclient_class):
     quota_utils._keystone_client(self.context)
     ksclient_class.assert_called_once_with(auth_url=self.auth_url,
                                            session=ksclient_session(),
                                            version=(3, 0))