#NEWLINE# @ mock . patch ( 'rally.api.objects.Task' ) #NEWLINE# @ mock . patch ( 'rally.api.objects.Deployment' , return_value = fakes . FakeDeployment ( uuid = 'deployment_uuid' , admin = mock . MagicMock ( ) , users = [ ] ) ) #NEWLINE# @ mock . patch ( 'rally.api.engine.TaskEngine' ) #NEWLINE# def test_validate_engine_exception( self , mock_task_engine , mock_deployment , mock_task ) : #NEWLINE# #INDENT# excpt = exceptions . InvalidTaskException ( ) #NEWLINE# mock_task_engine . return_value . validate . side_effect = excpt #NEWLINE# self . assertRaises ( exceptions . InvalidTaskException , api . Task . validate , mock_task . return_value [ 'uuid' ] , 'config' )