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

Method test_dict_attributes

IPython/utils/tests/test_wildcard.py:115–128  ·  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

113 self.assertEqual(a,res)
114
115 def test_dict_attributes(self):
116 """Dictionaries should be indexed by attributes, not by keys. This was
117 causing Github issue 129."""
118 ns = {"az":{"king":55}, "pq":{1:0}}
119 tests = [
120 ("a*", ["az"]),
121 ("az.k*", ["az.keys"]),
122 ("pq.k*", ["pq.keys"])
123 ]
124 for pat, res in tests:
125 res.sort()
126 a = sorted(wildcard.list_namespace(ns, "all", pat, ignore_case=False,
127 show_all=True).keys())
128 self.assertEqual(a, res)
129
130 def test_dict_dir(self):
131 class A(object):

Callers

nothing calls this directly

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected