#NEWLINE# @ mock . patch ( 'paasta_tools.cli.cmds.local_run.perform_http_healthcheck' ) #NEWLINE# @ mock . patch ( 'time.sleep' ) #NEWLINE# def test_run_healthcheck_http_fails( mock_sleep , mock_perform_http_healthcheck ) : #NEWLINE# #INDENT# mock_docker_client = mock . MagicMock ( spec_set = docker . Client ) #NEWLINE# fake_container_id = 'fake_container_id' #NEWLINE# fake_mode = 'http' #NEWLINE# fake_url = 'http://fakehost:666/fake_status_path' #NEWLINE# fake_timeout = 10 #NEWLINE# mock_perform_http_healthcheck . return_value = False #NEWLINE# assert ( not run_healthcheck_on_container ( mock_docker_client , fake_container_id , fake_mode , fake_url , fake_timeout ) ) #NEWLINE# mock_perform_http_healthcheck . assert_called_once_with ( fake_url , fake_timeout )