(self)
| 75 | x.__dict__ |
| 76 | |
| 77 | def test_dir(self): |
| 78 | |
| 79 | class X: |
| 80 | |
| 81 | def __dir__(self): |
| 82 | return ['a', 'b', 'c'] |
| 83 | |
| 84 | x = Proxy(lambda: X()) |
| 85 | assert dir(x) == ['a', 'b', 'c'] |
| 86 | |
| 87 | class Y: |
| 88 | |
| 89 | def __dir__(self): |
| 90 | raise RuntimeError() |
| 91 | y = Proxy(lambda: Y()) |
| 92 | assert dir(y) == [] |
| 93 | |
| 94 | def test_getsetdel_attr(self): |
| 95 |