def is_redirect(from_host, from_path, to_url): response = PatchServlet(Request.ForTest(from_path, host=from_host), _PatchServletDelegate()).Get() redirect_url, _ = response.GetRedirect() if redirect_url is None: return (False, '%s/%s did not cause a redirect' % (from_host, from_path)) if redirect_url != to_url: return (False, '%s/%s redirected to %s not %s' % (from_host, from_path, redirect_url, to_url)) return (True, '%s/%s redirected to %s' % (from_host, from_path, redirect_url))
def _RenderWithPatch(self, path, issue): path_with_issue = '%s/%s' % (issue, path) return PatchServlet( Request.ForTest(path_with_issue, host=_ALLOWED_HOST), _PatchServletDelegate()).Get()