MCPcopy Index your code
hub / github.com/ipython/ipython / test_dict_attributes

Method test_dict_attributes

tests/test_wildcard.py:236–248  ·  view source on GitHub ↗

Dictionaries should be indexed by attributes, not by keys. This was causing Github issue 129.

(self)

Source from the content-addressed store, hash-verified

234 self.assertEqual(a, res)
235
236 def test_dict_attributes(self):
237 """Dictionaries should be indexed by attributes, not by keys. This was
238 causing Github issue 129."""
239 ns = {"az": {"king": 55}, "pq": {1: 0}}
240 tests = [("a*", ["az"]), ("az.k*", ["az.keys"]), ("pq.k*", ["pq.keys"])]
241 for pat, res in tests:
242 res.sort()
243 a = sorted(
244 wildcard.list_namespace(
245 ns, "all", pat, ignore_case=False, show_all=True
246 ).keys()
247 )
248 self.assertEqual(a, res)
249
250 def test_dict_dir(self):
251 class A(object):

Callers

nothing calls this directly

Calls 2

sortMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected