예제 #1
0
 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))
예제 #2
0
 def _RenderWithPatch(self, path, issue):
     path_with_issue = '%s/%s' % (issue, path)
     return PatchServlet(
         Request.ForTest(path_with_issue, host=_ALLOWED_HOST),
         _PatchServletDelegate()).Get()