This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author joneskoo
Recipients carljm, jcea, joneskoo, maker, orsenthil
Date 2012-01-06.14:53:48
SpamBayes Score 1.2875224e-08
Marked as misclassified No
Message-id <1325861628.99.0.523505302995.issue13642@psf.upfronthosting.co.za>
In-reply-to
Content
> It is better to do the explicitly above the b64 encoding step.
> Just as host has been unquoted.
> 
>                     user_passwd, host = splituser(host)
>                     host = unquote(host)

Ok. So it needs to be done on the line after import base64.

> Also, you have done this only for https_open, the same would need be
> replicated for http_open and also for proxy_passwd.

So four cases where this may need to be fixed and my test only covers one of them:

* http without proxy
* http with proxy
* https without proxy
* https with proxy

Copypasted code :(

Can the https and the proxy auth be tested with the same fake http connection, when the request is stored?

>              def sendall(self, str):
> -                pass
> +                FakeHTTPConnection.request += str
> 
> seems a bit odd to me

Agreed, not clean and needs to be fixed. Works here, but could cause the test code to become unreadable later on. Wrote it at 5 am, not getting sleep. Please provide a cleaner alternative. :)

One question: how come the fake http is given HTTP headers in some tests and payload only in others? Is it emulating the TCP stream or the payload stream handle? It can't do both, can it? Are the headers in some tests actually doing anything?

I would not mind if someone else finished the patch :)
History
Date User Action Args
2012-01-06 14:53:49joneskoosetrecipients: + joneskoo, jcea, orsenthil, carljm, maker
2012-01-06 14:53:48joneskoosetmessageid: <1325861628.99.0.523505302995.issue13642@psf.upfronthosting.co.za>
2012-01-06 14:53:48joneskoolinkissue13642 messages
2012-01-06 14:53:48joneskoocreate