(self)
| 625 | self.assertEqual(args, (req,)) |
| 626 | |
| 627 | def test_handler_order(self): |
| 628 | o = OpenerDirector() |
| 629 | handlers = [] |
| 630 | for meths, handler_order in [([("http_open", "return self")], 500), |
| 631 | (["http_open"], 0)]: |
| 632 | class MockHandlerSubclass(MockHandler): |
| 633 | pass |
| 634 | |
| 635 | h = MockHandlerSubclass(meths) |
| 636 | h.handler_order = handler_order |
| 637 | handlers.append(h) |
| 638 | o.add_handler(h) |
| 639 | |
| 640 | o.open("http://example.com/") |
| 641 | # handlers called in reverse order, thanks to their sort order |
| 642 | self.assertEqual(o.calls[0][0], handlers[1]) |
| 643 | self.assertEqual(o.calls[1][0], handlers[0]) |
| 644 | |
| 645 | def test_raise(self): |
| 646 | # raising URLError stops processing of request |
nothing calls this directly
no test coverage detected