#NEWLINE# @ mock . patch ( 'awscli.customizations.emr.emr.CreateDefaultRoles._construct_result' ) #NEWLINE# @ mock . patch ( 'awscli.customizations.emr.createdefaultroles.get_service_principal' ) #NEWLINE# @ mock . patch ( 'awscli.customizations.emr.emr.CreateDefaultRoles._check_if_instance_profile_exists' ) #NEWLINE# @ mock . patch ( 'awscli.customizations.emr.emr.CreateDefaultRoles._check_if_role_exists' ) #NEWLINE# @ mock . patch ( 'awscli.customizations.emr.emr.CreateDefaultRoles._get_role_policy' ) #NEWLINE# def test_get_service_principal_parameters( self , get_rp_patch , role_exists_patch , instance_profile_exists_patch , get_sp_patch , construct_result_patch ) : #NEWLINE# #INDENT# get_rp_patch . return_value = 'blah' #NEWLINE# get_sp_patch . return_value = 'elasticmapreduce.amazonaws.abc' #NEWLINE# role_exists_patch . return_value = False #NEWLINE# instance_profile_exists_patch . return_value = False #NEWLINE# construct_result_patch . return_value = [ ] #NEWLINE# endpoint_url = 'https://elasticmapreduce.abc' #NEWLINE# cmdline = ( ( instance_profile_exists_patch . prefix + ' --endpoint ' ) + endpoint_url ) #NEWLINE# self . run_cmd ( cmdline , expected_rc = 0 ) #NEWLINE# self . assertEquals ( get_sp_patch . call_args [ 0 ] [ 1 ] , endpoint_url )