quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: httpd-python/test/htdocs tests.py
Date Tue, 24 Jun 2003 06:54:34 GMT
On Tue, Jun 24, 2003 at 04:16:01AM -0000, grisha@apache.org wrote:
>...
>   +++ test.py	24 Jun 2003 04:16:00 -0000	1.32
>...
>   +        conn = httplib.HTTPConnection("127.0.0.1:%s" % PORT)

Much simpler to write that as:

  conn = httplib.HTTPConnection('127.0.0.1', PORT)

>   +        conn.putrequest("GET", "/testz.py", skip_host=1)

Note that the skip_host argument didn't appear until 2.2.1. People won't be
able to run this test with anything less. (maybe not a problem?)

>   +        # this is three cookies, nastily formatted
>   +        conn.putheader("Host", "test_Cookie_Cookie:%s" % PORT)
>   +        conn.putheader("Cookie", "spam=foo; path=blah;;eggs=bar;")
>   +        conn.putheader("Cookie", "bar=foo")
>   +        conn.endheaders()

And to write this as:

  conn.request('GET', '/testz.py', headers={
    'Host' : 'test_Cookie_Cookie:%s' % PORT,
    'Cookie' : ...
    })

>...
>   +        conn = httplib.HTTPConnection("127.0.0.1:%s" % PORT)
>   +        conn.putrequest("GET", "/testz.py", skip_host=1)
>   +        conn.putheader("Host", "test_Cookie_MarshalCookie:%s" % PORT)
>   +        conn.putheader("Cookie", mc)
>   +        conn.endheaders()

Same.

>...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message