def test_get_neutron_client(self, nclient, IdentityServiceContext):
     creds = {
         'auth_protocol': 'http',
         'auth_host': 'myhost',
         'auth_port': '2222',
         'admin_user': '******',
         'admin_password': '******',
         'admin_tenant_name': 'tenant1',
         'region': 'region2',
     }
     IdentityServiceContext.return_value = \
         DummyIdentityServiceContext(return_value=creds)
     nutils.get_neutron_client()
     nclient.assert_called_with(
         username='******',
         tenant_name='tenant1',
         password='******',
         auth_url='http://myhost:2222/v2.0',
         region_name='region2',
     )
 def test_get_neutron_client_noidservice(self, IdentityServiceContext):
     creds = {}
     IdentityServiceContext.return_value = \
         DummyIdentityServiceContext(return_value=creds)
     self.assertEquals(nutils.get_neutron_client(), None)
예제 #3
0
 def test_get_neutron_client_noidservice(self, IdentityServiceContext):
     creds = {}
     IdentityServiceContext.return_value = \
         DummyIdentityServiceContext(return_value=creds)
     self.assertEquals(nutils.get_neutron_client(), None)