(self)
| 4676 | self.assertIsInstance(pa, C) # Test |
| 4677 | |
| 4678 | def test_proxy_super(self): |
| 4679 | # Testing super() for a proxy object... |
| 4680 | class Proxy(object): |
| 4681 | def __init__(self, obj): |
| 4682 | self.__obj = obj |
| 4683 | def __getattribute__(self, name): |
| 4684 | if name.startswith("_Proxy__"): |
| 4685 | return object.__getattribute__(self, name) |
| 4686 | else: |
| 4687 | return getattr(self.__obj, name) |
| 4688 | |
| 4689 | class B(object): |
| 4690 | def f(self): |
| 4691 | return "B.f" |
| 4692 | |
| 4693 | class C(B): |
| 4694 | def f(self): |
| 4695 | return super(C, self).f() + "->C.f" |
| 4696 | |
| 4697 | obj = C() |
| 4698 | p = Proxy(obj) |
| 4699 | self.assertEqual(C.__dict__["f"](p), "B.f->C.f") |
| 4700 | |
| 4701 | def test_carloverre(self): |
| 4702 | # Testing prohibition of Carlo Verre's hack... |
nothing calls this directly
no test coverage detected