#NEWLINE# @ mock . patch ( 'rally.common.fileutils._rewrite_env_file' ) #NEWLINE# @ mock . patch ( 'rally.cli.commands.task.api.Task.get' , return_value = True ) #NEWLINE# def test_use( self , mock_task_get , mock__rewrite_env_file ) : #NEWLINE# #INDENT# task_id = '80422553-5774-44bd-98ac-38bd8c7a0feb' #NEWLINE# self . task . use ( task_id ) #NEWLINE# mock__rewrite_env_file . assert_called_once_with ( os . path . expanduser ( '~/.rally/globals' ) , [ ( 'RALLY_TASK=%s\n' % mock_task_get ) ] )