def stub_out_registry_server(stubs, **kwargs):
 def fake_get_connection_type(client):
  '\n        Returns the proper connection type\n        '
  DEFAULT_REGISTRY_PORT = 9191
  if ((client.port == DEFAULT_REGISTRY_PORT) and (client.host == '0.0.0.0')):
   return FakeRegistryConnection
 def fake_image_iter(self):
  for i in self.response.app_iter:
   (yield i)
 stubs.Set(glance.common.client.BaseClient, 'get_connection_type', fake_get_connection_type)

def stub_out_registry_server ( stubs , ** kwargs ) : def fake_get_connection_type ( client ) : DEFAULT_REGISTRY_PORT = 9191 if ( ( client . port == DEFAULT_REGISTRY_PORT ) and ( client . host == '0.0.0.0' ) ) : return FakeRegistryConnection def fake_image_iter ( self ) : for i in self . response . app_iter : ( yield i ) stubs . Set ( glance . common . client . BaseClient , 'get_connection_type' , fake_get_connection_type )
mocks calls to 127 .