开发者

How do I mock a urllib2 response when using a custom opener?

I'm installing a custom urllib2 BaseHandler to deal with HTTP 304 responses (as per here), and this works fine. However, when testing my other methods, I u开发者_StackOverflowse the method from this SO answer, which works perfectly. However, since the method from the first answer overrides the custom opener, I cant use it for testing. Is there an alternative approach?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜