MCPcopy Index your code
hub / github.com/python/cpython / test_no_protocol_methods

Method test_no_protocol_methods

Lib/test/test_urllib2.py:580–595  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

578 OpenerDirector().add_handler, NonHandler())
579
580 def test_no_protocol_methods(self):
581 # test the case that methods starts with handler type without the protocol
582 # like open*() or _open*().
583 # These methods should be ignored
584
585 o = OpenerDirector()
586 meth_spec = [
587 ["open"],
588 ["_open"],
589 ["error"]
590 ]
591
592 add_ordered_mock_handlers(o, meth_spec)
593
594 self.assertEqual(len(o.handle_open), 0)
595 self.assertEqual(len(o.handle_error), 0)
596
597 def test_badly_named_methods(self):
598 # test work-around for three methods that accidentally follow the

Callers

nothing calls this directly

Calls 3

OpenerDirectorClass · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected