#NEWLINE# @ mock . patch . object ( TaskProcessor , 'ensure_task_based_deploy_allowed' ) #NEWLINE# def test_fallback_to_granular_deploy( self , ensure_allowed ) : #NEWLINE# #INDENT# ensure_allowed . side_effect = errors . TaskBaseDeploymentNotAllowed #NEWLINE# message = self . get_deploy_message ( ) #NEWLINE# self . assertEqual ( 'granular_deploy' , message [ 'method' ] ) #NEWLINE# self . assertItemsEqual ( [ 'task_uuid' , 'deployment_info' , 'pre_deployment' , 'post_deployment' ] , ensure_allowed [ 'args' ] ) #NEWLINE# ensure_allowed . assert_called_once_with ( mock . ANY )