MCPcopy Create free account
hub / github.com/celery/celery / test_dir

Method test_dir

t/unit/utils/test_local.py:77–92  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

ProxyClass · 0.90
XClass · 0.70
YClass · 0.70

Tested by

no test coverage detected