#NEWLINE# def mock_glance( self ) : #NEWLINE# #INDENT# glance_patcher = mock . patch ( 'glanceclient.client.Client' ) #NEWLINE# glance = mock . create_autospec ( glanceclient . Client ( endpoint = 'v1' ) ) #NEWLINE# glance_patcher . start ( ) . return_value = glance #NEWLINE# self . addCleanup ( glance_patcher . stop ) #NEWLINE# return glance