(self)
| 642 | self.assertEqual(args, (req,)) |
| 643 | |
| 644 | def test_handler_order(self): |
| 645 | o = OpenerDirector() |
| 646 | handlers = [] |
| 647 | for meths, handler_order in [([("http_open", "return self")], 500), |
| 648 | (["http_open"], 0)]: |
| 649 | class MockHandlerSubclass(MockHandler): |
| 650 | pass |
| 651 | |
| 652 | h = MockHandlerSubclass(meths) |
| 653 | h.handler_order = handler_order |
| 654 | handlers.append(h) |
| 655 | o.add_handler(h) |
| 656 | |
| 657 | o.open("http://example.com/") |
| 658 | # handlers called in reverse order, thanks to their sort order |
| 659 | self.assertEqual(o.calls[0][0], handlers[1]) |
| 660 | self.assertEqual(o.calls[1][0], handlers[0]) |
| 661 | |
| 662 | def test_raise(self): |
| 663 | # raising URLError stops processing of request |
nothing calls this directly
no test coverage detected