| 49 | ## |
| 50 | |
| 51 | def test(): |
| 52 | manager = MyManager() |
| 53 | manager.start() |
| 54 | |
| 55 | print('-' * 20) |
| 56 | |
| 57 | f1 = manager.Foo1() |
| 58 | f1.f() |
| 59 | f1.g() |
| 60 | assert not hasattr(f1, '_h') |
| 61 | assert sorted(f1._exposed_) == sorted(['f', 'g']) |
| 62 | |
| 63 | print('-' * 20) |
| 64 | |
| 65 | f2 = manager.Foo2() |
| 66 | f2.g() |
| 67 | f2._h() |
| 68 | assert not hasattr(f2, 'f') |
| 69 | assert sorted(f2._exposed_) == sorted(['g', '_h']) |
| 70 | |
| 71 | print('-' * 20) |
| 72 | |
| 73 | it = manager.baz() |
| 74 | for i in it: |
| 75 | print('<%d>' % i, end=' ') |
| 76 | print() |
| 77 | |
| 78 | print('-' * 20) |
| 79 | |
| 80 | op = manager.operator() |
| 81 | print('op.add(23, 45) =', op.add(23, 45)) |
| 82 | print('op.pow(2, 94) =', op.pow(2, 94)) |
| 83 | print('op._exposed_ =', op._exposed_) |
| 84 | |
| 85 | ## |
| 86 | |