def test_configure_registry_client_not_using_use_user_token(self): self.config(use_user_token=False) self.mox.StubOutWithMock(rapi, 'configure_registry_admin_creds') rapi.configure_registry_admin_creds() self.mox.ReplayAll() rapi.configure_registry_client() self.mox.VerifyAll()
def test_configure_registry_admin_creds_with_auth_url(self): expected = self._get_fake_config_creds() self.config(admin_user=expected['user']) self.config(admin_password=expected['password']) self.config(admin_tenant_name=expected['tenant']) self.config(auth_url=expected['auth_url']) self.config(auth_strategy='test_strategy') self.config(auth_region=expected['region']) self.assertIsNone(rapi._CLIENT_CREDS) rapi.configure_registry_admin_creds() self.assertEqual(expected, rapi._CLIENT_CREDS)
def test_configure_registry_admin_creds_with_auth_url(self): expected = self._get_fake_config_creds() self.config(admin_user=expected['user']) self.config(admin_password=expected['password']) self.config(admin_tenant_name=expected['tenant']) self.config(auth_url=expected['auth_url']) self.config(auth_strategy='test_strategy') self.config(auth_region=expected['region']) self.assertEquals(rapi._CLIENT_CREDS, None) rapi.configure_registry_admin_creds() self.assertEquals(rapi._CLIENT_CREDS, expected)
def test_configure_registry_admin_creds_with_auth_url(self): expected = self._get_fake_config_creds() self.config(admin_user=expected["user"]) self.config(admin_password=expected["password"]) self.config(admin_tenant_name=expected["tenant"]) self.config(auth_url=expected["auth_url"]) self.config(auth_strategy="test_strategy") self.config(auth_region=expected["region"]) self.assertEqual(rapi._CLIENT_CREDS, None) rapi.configure_registry_admin_creds() self.assertEqual(rapi._CLIENT_CREDS, expected)
def test_configure_registry_admin_creds(self): expected = self._get_fake_config_creds(auth_url=None, strategy="configured_strategy") self.config(admin_user=expected["user"]) self.config(admin_password=expected["password"]) self.config(admin_tenant_name=expected["tenant"]) self.config(auth_strategy=expected["strategy"]) self.config(auth_region=expected["region"]) self.stubs.Set(os, "getenv", lambda x: None) self.assertEqual(rapi._CLIENT_CREDS, None) rapi.configure_registry_admin_creds() self.assertEqual(rapi._CLIENT_CREDS, expected)
def test_configure_registry_admin_creds(self): expected = self._get_fake_config_creds(auth_url=None, strategy='configured_strategy') self.config(admin_user=expected['user']) self.config(admin_password=expected['password']) self.config(admin_tenant_name=expected['tenant']) self.config(auth_strategy=expected['strategy']) self.config(auth_region=expected['region']) self.stubs.Set(os, 'getenv', lambda x: None) self.assertIsNone(rapi._CLIENT_CREDS) rapi.configure_registry_admin_creds() self.assertEqual(expected, rapi._CLIENT_CREDS)
def test_configure_registry_admin_creds(self): expected = self._get_fake_config_creds(auth_url=None, strategy='configured_strategy') self.config(admin_user=expected['user']) self.config(admin_password=expected['password']) self.config(admin_tenant_name=expected['tenant']) self.config(auth_strategy=expected['strategy']) self.config(auth_region=expected['region']) self.stubs.Set(os, 'getenv', lambda x: None) self.assertEquals(rapi._CLIENT_CREDS, None) rapi.configure_registry_admin_creds() self.assertEquals(rapi._CLIENT_CREDS, expected)
def test_configure_registry_admin_creds_with_auth_url(self): expected = { 'user': '******', 'password': '******', 'username': '******', 'tenant': 'tenant', 'auth_url': 'auth_url', 'strategy': 'keystone', 'region': 'region', } self.config(admin_user=expected['user']) self.config(admin_password=expected['password']) self.config(admin_tenant_name=expected['tenant']) self.config(auth_url=expected['auth_url']) self.config(auth_strategy='test_strategy') self.config(auth_region=expected['region']) self.assertEquals(rapi._CLIENT_CREDS, None) rapi.configure_registry_admin_creds() self.assertEquals(rapi._CLIENT_CREDS, expected)
def test_configure_registry_admin_creds(self): expected = { 'user': '******', 'password': '******', 'username': '******', 'tenant': 'tenant', 'auth_url': None, 'strategy': 'configured_strategy', 'region': 'region', } self.config(admin_user=expected['user']) self.config(admin_password=expected['password']) self.config(admin_tenant_name=expected['tenant']) self.config(auth_strategy=expected['strategy']) self.config(auth_region=expected['region']) self.stubs.Set(os, 'getenv', lambda x: None) self.assertEquals(rapi._CLIENT_CREDS, None) rapi.configure_registry_admin_creds() self.assertEquals(rapi._CLIENT_CREDS, expected)