#NEWLINE# @ mock . patch ( 'rally.cli.commands.task.os.path.isfile' , return_value = True ) #NEWLINE# @ mock . patch ( 'rally.cli.commands.task.api.Task.create' , return_value = fakes . FakeTask ( uuid = 'some_new_uuid' , tag = 'tag' ) ) #NEWLINE# @ mock . patch ( 'rally.cli.commands.task.TaskCommands.use' ) #NEWLINE# @ mock . patch ( 'rally.cli.commands.task.TaskCommands.detailed' ) #NEWLINE# @ mock . patch ( 'rally.cli.commands.task.TaskCommands._load_task' , return_value = { #NEWLINE# #INDENT# 'some' : 'json' , #NEWLINE# #UNINDENT# } ) #NEWLINE# @ mock . patch ( 'rally.cli.commands.task.api.Task.validate' , return_value = fakes . FakeTask ( some = 'json' , uuid = 'some_uuid' , temporary = True ) ) #NEWLINE# @ mock . patch ( 'rally.cli.commands.task.api.Task.start' ) #NEWLINE# def test_start( self , mock_task_start , mock_task_validate , mock__load_task , mock_detailed , mock_use , mock_task_create , mock_os_path_isfile ) : #NEWLINE# #INDENT# deployment_id = 'e0617de9-77d1-4875-9b49-9d5789e29f20' #NEWLINE# task_path = 'path_to_config.json' #NEWLINE# self . task . start ( task_path , deployment_id , do_use = True ) #NEWLINE# mock_task_create . assert_called_once_with ( deployment_id , None ) #NEWLINE# mock_task_start . assert_called_once_with ( deployment_id , mock__load_task . return_value , task = mock_task_validate . return_value , abort_on_sla_failure = False ) #NEWLINE# mock__load_task . assert_called_once_with ( task_path , None , None ) #NEWLINE# mock_use . assert_called_once_with ( 'some_new_uuid' ) #NEWLINE# mock_detailed . assert_called_once_with ( task_id = 'some_new_uuid' )