summaryrefslogtreecommitdiff
path: root/Lib/test/test_urllib2.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-07-12 08:05:45 +0000
committerGeorg Brandl <georg@python.org>2007-07-12 08:05:45 +0000
commitf91149e4a194621b08346ce3f110712a174e271c (patch)
treed21757aed1764d8da0871f29b39662ff333f48f8 /Lib/test/test_urllib2.py
parentc6057c7812ac3dd05a80255b4750f606a0f79f81 (diff)
downloadcpython-git-f91149e4a194621b08346ce3f110712a174e271c.tar.gz
Patch #1752270, #1750931: complain if urllib2 add_handler called
without handler.
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r--Lib/test/test_urllib2.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index c9dcf5ef7b..90e1771733 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -381,6 +381,12 @@ class MockPasswordManager:
class OpenerDirectorTests(unittest.TestCase):
+ def test_add_non_handler(self):
+ class NonHandler(object):
+ pass
+ self.assertRaises(TypeError,
+ OpenerDirector().add_handler, NonHandler())
+
def test_badly_named_methods(self):
# test work-around for three methods that accidentally follow the
# naming conventions for handler methods