Ejemplo n.º 1
0
 def test_get_client_using_provided_host(self):
     cli = client.get_client(self.host)
     cli._do_request = mock.MagicMock()
     cli.configure_from_url = mock.MagicMock()
     cli.auth_plugin.management_url = mock.MagicMock()
     cli.do_request("GET", "/queued_images")
     self.assertFalse(cli.configure_from_url.called)
     self.assertFalse(client.get_client(self.host).configure_via_auth)
Ejemplo n.º 2
0
 def test_get_client_using_provided_host(self):
     cli = client.get_client(self.host)
     cli._do_request = mock.MagicMock()
     cli.configure_from_url = mock.MagicMock()
     cli.auth_plugin.management_url = mock.MagicMock()
     cli.do_request("GET", "/queued_images")
     self.assertFalse(cli.configure_from_url.called)
     self.assertFalse(client.get_client(self.host).configure_via_auth)
Ejemplo n.º 3
0
 def test_get_client_host_only(self):
     expected_creds = {
         "username": None,
         "password": None,
         "tenant": None,
         "auth_url": None,
         "strategy": "noauth",
         "region": None,
     }
     self.assertEqual(expected_creds, client.get_client(self.host).creds)
Ejemplo n.º 4
0
 def test_get_client_host_only(self):
     expected_creds = {
         'username': None,
         'password': None,
         'tenant': None,
         'auth_url': None,
         'strategy': 'noauth',
         'region': None
     }
     self.assertEqual(expected_creds, client.get_client(self.host).creds)
Ejemplo n.º 5
0
 def test_get_client_host_only(self):
     expected_creds = {
         'username': None,
         'password': None,
         'tenant': None,
         'auth_url': None,
         'strategy': 'noauth',
         'region': None
     }
     self.assertEqual(expected_creds, client.get_client(self.host).creds)
Ejemplo n.º 6
0
 def test_get_client_all_creds(self):
     expected_creds = {
         'username': '******',
         'password': '******',
         'tenant': 'ten',
         'auth_url': 'url',
         'strategy': 'keystone',
         'region': 'reg'
     }
     creds = client.get_client(self.host,
                               username='******',
                               password='******',
                               tenant='ten',
                               auth_url='url',
                               auth_strategy='strategy',
                               region='reg').creds
     self.assertEqual(expected_creds, creds)
Ejemplo n.º 7
0
 def test_get_client_all_creds(self):
     expected_creds = {
         "username": "******",
         "password": "******",
         "tenant": "ten",
         "auth_url": "url",
         "strategy": "keystone",
         "region": "reg",
     }
     creds = client.get_client(
         self.host,
         username="******",
         password="******",
         tenant="ten",
         auth_url="url",
         auth_strategy="strategy",
         region="reg",
     ).creds
     self.assertEqual(expected_creds, creds)
Ejemplo n.º 8
0
 def test_get_client_all_creds(self):
     expected_creds = {
         'username': '******',
         'password': '******',
         'tenant': 'ten',
         'auth_url': 'url',
         'strategy': 'keystone',
         'region': 'reg'
     }
     creds = client.get_client(
         self.host,
         username='******',
         password='******',
         tenant='ten',
         auth_url='url',
         auth_strategy='strategy',
         region='reg'
     ).creds
     self.assertEqual(expected_creds, creds)