Dictionaries should be indexed by attributes, not by keys. This was causing Github issue 129.
(self)
| 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): |