(self)
| 408 | |
| 409 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 410 | def test_callable_proxy(self): |
| 411 | o = Callable() |
| 412 | ref1 = weakref.proxy(o) |
| 413 | |
| 414 | self.check_proxy(o, ref1) |
| 415 | |
| 416 | self.assertIs(type(ref1), weakref.CallableProxyType, |
| 417 | "proxy is not of callable type") |
| 418 | ref1('twinkies!') |
| 419 | self.assertEqual(o.bar, 'twinkies!', |
| 420 | "call through proxy not passed through to original") |
| 421 | ref1(x='Splat.') |
| 422 | self.assertEqual(o.bar, 'Splat.', |
| 423 | "call through proxy not passed through to original") |
| 424 | |
| 425 | # expect due to too few args |
| 426 | self.assertRaises(TypeError, ref1) |
| 427 | |
| 428 | # expect due to too many args |
| 429 | self.assertRaises(TypeError, ref1, 1, 2, 3) |
| 430 | |
| 431 | def check_proxy(self, o, proxy): |
| 432 | o.foo = 1 |
nothing calls this directly
no test coverage detected