#NEWLINE# @ mock . patch ( 'rally.cli.commands.task.open' , create = True ) #NEWLINE# def test__load_task( self , mock_open ) : #NEWLINE# #INDENT# input_task = "{'ab': {{test}}}" #NEWLINE# input_args = "{'test': 2}" #NEWLINE# mock_open . side_effect = [ mock . mock_open ( read_data = "{'test': 1}" ) . return_value , mock . mock_open ( read_data = input_task ) . return_value ] #NEWLINE# task_conf = self . task . _load_task ( 'in_task' , task_args_file = 'in_args_path' ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'ab' : 1 , #NEWLINE# #UNINDENT# } , task_conf ) #NEWLINE# mock_open . side_effect = [ mock . mock_open ( read_data = input_task ) . return_value ] #NEWLINE# task_conf = self . task . _load_task ( 'in_task' , task_args = input_args ) #NEWLINE# self . assertEqual ( task_conf , { #NEWLINE# #INDENT# 'ab' : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# mock_open . side_effect = [ mock . mock_open ( read_data = "{'test': 1}" ) . return_value , mock . mock_open ( read_data = input_task ) . return_value ] #NEWLINE# task_conf = self . task . _load_task ( 'in_task' , task_args = input_args , task_args_file = 'any_file' ) #NEWLINE# self . assertEqual ( task_conf , { #NEWLINE# #INDENT# 'ab' : 2 , #NEWLINE# #UNINDENT# } )