#NEWLINE# def tests_status_marathon_job_when_running_running_no_tasks( ) : #NEWLINE# #INDENT# client = mock . create_autospec ( marathon . MarathonClient ) #NEWLINE# app = mock . create_autospec ( marathon . models . app . MarathonApp ) #NEWLINE# client . get_app . return_value = app #NEWLINE# service = 'my_service' #NEWLINE# instance = 'my_instance' #NEWLINE# app_id = 'mock_app_id' #NEWLINE# normal_instance_count = 5 #NEWLINE# mock_tasks_running = 0 #NEWLINE# app . tasks_running = mock_tasks_running #NEWLINE# app . deployments = [ ] #NEWLINE# with contextlib . nested ( mock . patch ( 'paasta_tools.marathon_tools.is_app_id_running' , return_value = True ) ) as ( is_app_id_running_patch , ) : #NEWLINE# #INDENT# marathon_serviceinit . status_marathon_job ( service , instance , app_id , normal_instance_count , client ) #NEWLINE# is_app_id_running_patch . assert_called_once_with ( app_id , client )