#NEWLINE# @ mock . patch . object ( keystone , 'get_admin_auth_token' , autospec = True ) #NEWLINE# @ mock . patch . object ( glance_v1_service . GlanceImageService , '__init__' , return_value = None , autospec = True ) #NEWLINE# def test_get_glance_image_service_token_not_needed( self , glance_service_mock , token_mock ) : #NEWLINE# #INDENT# image_href = 'image-uuid' #NEWLINE# self . context . auth_token = None #NEWLINE# self . config ( auth_strategy = 'noauth' , group = 'glance' ) #NEWLINE# image_service . get_image_service ( image_href , context = self . context ) #NEWLINE# glance_service_mock . assert_called_once_with ( mock . ANY , None , 1 , self . context ) #NEWLINE# self . assertFalse ( self . called ) #NEWLINE# self . assertIsNone ( self . context . auth_token )