[Python-Dev] [Python-checkins] cpython: ../bug-fixes/http_error_interface/.hg/last-message.txt (original) (raw)

Senthil Kumaran senthil at uthcode.com
Tue Mar 19 20:17:20 CET 2013


Looks like I used hg commit -m /path/to/.hg/last-message.txt instead of hg commit -l /path/to/.hg/last-message.txt I have amended it, merged it and pushed it again.

On Tue, Mar 19, 2013 at 12:04 PM, senthil.kumaran <python-checkins at python.org> wrote:

http://hg.python.org/cpython/rev/4f2080e9eee2 changeset: 82765:4f2080e9eee2 parent: 82763:4c6463b96a2c user: Senthil Kumaran <senthil at uthcode.com> date: Tue Mar 19 12:07:43 2013 -0700 summary: ../bug-fixes/httperrorinterface/.hg/last-message.txt

files: Lib/test/testurllib2.py | 39 +++++++++++++-------------- 1 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/Lib/test/testurllib2.py b/Lib/test/testurllib2.py --- a/Lib/test/testurllib2.py +++ b/Lib/test/testurllib2.py @@ -1387,6 +1387,10 @@ class MiscTests(unittest.TestCase): + def openerhashandler(self, opener, handlerclass): + self.assertTrue(any(h.class == handlerclass + for h in opener.handlers)) + def testbuildopener(self): class MyHTTPHandler(urllib.request.HTTPHandler): pass class FooHandler(urllib.request.BaseHandler): @@ -1439,10 +1443,22 @@ self.assertEqual(b"1234567890", request.data) self.assertEqual("10", request.getheader("Content-length")) + def testHTTPErrorinterface(self): + """ + Issue 13211 reveals that HTTPError didn't implement the URLError + interface even though HTTPError is a subclass of URLError. - def openerhashandler(self, opener, handlerclass): - self.assertTrue(any(h.class == handlerclass - for h in opener.handlers)) + >>> msg = 'something bad happened' + >>> url = code = fp = None + >>> hdrs = 'Content-Length: 42' + >>> err = urllib.error.HTTPError(url, code, msg, hdrs, fp) + >>> assert hasattr(err, 'reason') + >>> err.reason + 'something bad happened' + >>> assert hasattr(err, 'headers') + >>> err.headers + 'Content-Length: 42' + """ class RequestTests(unittest.TestCase): @@ -1514,23 +1530,6 @@ req = Request(url) self.assertEqual(req.getfullurl(), url) -def testHTTPErrorinterface(): - """ - Issue 13211 reveals that HTTPError didn't implement the URLError - interface even though HTTPError is a subclass of URLError. - - >>> msg = 'something bad happened' - >>> url = code = fp = None - >>> hdrs = 'Content-Length: 42' - >>> err = urllib.error.HTTPError(url, code, msg, hdrs, fp) - >>> assert hasattr(err, 'reason') - >>> err.reason - 'something bad happened' - >>> assert hasattr(err, 'headers') - >>> err.headers - 'Content-Length: 42' - """ - def testmain(verbose=None): from test import testurllib2 support.rundoctest(testurllib2, verbose) -- Repository URL: http://hg.python.org/cpython


Python-checkins mailing list Python-checkins at python.org http://mail.python.org/mailman/listinfo/python-checkins



More information about the Python-Dev mailing list