#NEWLINE# @ mock . patch ( 'rally.common.objects.deploy.db.deployment_update' ) #NEWLINE# @ mock . patch ( 'rally.common.objects.deploy.db.deployment_create' ) #NEWLINE# @ mock . patch ( 'rally.deployment.engine.Engine.validate' , side_effect = jsonschema . ValidationError ( 'ValidationError' ) ) #NEWLINE# def test_create_validation_error( self , mock_engine_validate , mock_deployment_create , mock_deployment_update ) : #NEWLINE# #INDENT# mock_deployment_create . return_value = mock_deployment_create . deployment #NEWLINE# self . assertRaises ( jsonschema . ValidationError , api . Deployment . create , self . deployment_config , 'fake_deployment' ) #NEWLINE# mock_deployment_update . assert_called_once_with ( self . deployment_uuid , { #NEWLINE# #INDENT# 'status' : consts . DeployStatus . DEPLOY_FAILED , #NEWLINE# #UNINDENT# } )