#NEWLINE# @ mock . patch ( 'rally.task.exporter.TaskExporter.get' ) #NEWLINE# def test_export_exception( self , mock_task_exporter_get ) : #NEWLINE# #INDENT# mock_client = mock . Mock ( ) #NEWLINE# mock_exporter_class = mock . Mock ( return_value = mock_client ) #NEWLINE# mock_task_exporter_get . return_value = mock_exporter_class #NEWLINE# mock_client . export . side_effect = IOError #NEWLINE# self . task . export ( 'fake_uuid' , 'file-exporter:///fake_path.json' ) #NEWLINE# mock_task_exporter_get . assert_called_once_with ( 'file-exporter' ) #NEWLINE# mock_client . export . assert_called_once_with ( 'fake_uuid' )