def stub_out_image_service(test):
 image_service = FakeImageService()
 test.stub_out('nova.image.glance.get_remote_image_service', (lambda x, y: (image_service, y)))
 test.stub_out('nova.image.glance.get_default_image_service', (lambda : image_service))
 test.useFixture(nova_fixtures.ConfPatcher(group='glance', api_servers=['http://localhost:9292']))
 return image_service

def stub_out_image_service ( test ) : image_service = FakeImageService ( ) test . stub_out ( 'nova.image.glance.get_remote_image_service' , ( lambda x , y : ( image_service , y ) ) ) test . stub_out ( 'nova.image.glance.get_default_image_service' , ( lambda : image_service ) ) test . useFixture ( nova_fixtures . ConfPatcher ( group = 'glance' , api_servers = [ 'http://localhost:9292' ] ) ) return image_service
stubs out the image service for the test with the fakeimageservice .