#NEWLINE# @ mock . patch . object ( pbm , 'get_all_profiles' ) #NEWLINE# def test_get_profile_id_by_name( self , get_all_profiles ) : #NEWLINE# #INDENT# profiles = [ self . _create_profile ( str ( i ) , ( 'profile-%d' % i ) ) for i in range ( 0 , 10 ) ] #NEWLINE# get_all_profiles . return_value = profiles #NEWLINE# session = mock . Mock ( ) #NEWLINE# exp_profile_id = '5' #NEWLINE# profile_id = pbm . get_profile_id_by_name ( session , ( 'profile-%s' % exp_profile_id ) ) #NEWLINE# self . assertEqual ( exp_profile_id , exp_profile_id ) #NEWLINE# get_all_profiles . assert_called_once_with ( session )