MCPcopy Create free account
hub / github.com/ipython/ipython / test_dict_dir

Method test_dict_dir

IPython/utils/tests/test_wildcard.py:130–143  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 self.assertEqual(a, res)
129
130 def test_dict_dir(self):
131 class A(object):
132 def __init__(self):
133 self.a = 1
134 self.b = 2
135 def __getattribute__(self, name):
136 if name=="a":
137 raise AttributeError
138 return object.__getattribute__(self, name)
139
140 a = A()
141 adict = wildcard.dict_dir(a)
142 assert "a" not in adict # change to assertNotIn method in >= 2.7
143 self.assertEqual(adict["b"], 2)

Callers

nothing calls this directly

Calls 1

AClass · 0.70

Tested by

no test coverage detected