[Zope3-dev] Re: SVN: Zope3/trunk/src/zope/app/testing/dochttp.py only append "..." line to cleaned redirect test if there is a non-empty

Florent Guillaume fg at nuxeo.com
Wed Aug 10 12:02:54 EDT 2005


> Modified: Zope3/trunk/src/zope/app/testing/dochttp.py
> ===================================================================
> --- Zope3/trunk/src/zope/app/testing/dochttp.py	2005-08-09 18:33:26 UTC (rev 37819)
> +++ Zope3/trunk/src/zope/app/testing/dochttp.py	2005-08-09 20:00:55 UTC (rev 37820)
> @@ -129,13 +129,15 @@
>      print '  >>> print http(r"""'
>      print '  ...', '\n  ... '.join(request.lines())+'""")'
>      if response.code in (301, 302, 303) and clean_redirects:
> +        content_length = None
>          if response.headers:
>              for i in range(len(response.headers)):
>                  h, v = response.headers[i]
>                  if h == "Content-Length":
> +                    content_length = int(v.strip())

No need to strip(), int() does that by itself.

Florent

>                      response.headers[i] = (h, "...")
>          lines = response.header_lines()
> -        if lines:
> +        if lines and content_length:
>              lines.append("...")
>      else:
>          lines = response.lines()


-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope3-dev mailing list