#NEWLINE# @ mock . patch ( 'paasta_tools.cli.cmds.local_run.perform_cmd_healthcheck' ) #NEWLINE# @ mock . patch ( 'time.sleep' ) #NEWLINE# def test_run_healthcheck_cmd_success( mock_sleep , mock_perform_cmd_healthcheck ) : #NEWLINE# #INDENT# mock_docker_client = mock . MagicMock ( spec_set = docker . Client ) #NEWLINE# fake_container_id = 'fake_container_id' #NEWLINE# fake_mode = 'cmd' #NEWLINE# fake_cmd = '/bin/true' #NEWLINE# fake_timeout = 10 #NEWLINE# mock_perform_cmd_healthcheck . return_value = True #NEWLINE# assert run_healthcheck_on_container ( mock_docker_client , fake_container_id , fake_mode , fake_cmd , fake_timeout ) #NEWLINE# assert ( mock_perform_cmd_healthcheck . call_count == 1 ) #NEWLINE# mock_perform_cmd_healthcheck . assert_called_once_with ( mock_docker_client , fake_timeout , fake_cmd , fake_timeout )