def test_dict(self): cd = ConfigDict() cd.set(("core", ), "foo", "bla") cd.set(("core2", ), "foo", "bloe") self.assertEqual([("core2", ), ("core", )], cd.keys()) self.assertEqual(cd[("core", )], {'foo': 'bla'}) cd['a'] = 'b' self.assertEqual(cd['a'], 'b')
def test_dict(self): cd = ConfigDict() cd.set((b"core", ), b"foo", b"bla") cd.set((b"core2", ), b"foo", b"bloe") self.assertEqual([(b"core", ), (b"core2", )], list(cd.keys())) self.assertEqual(cd[(b"core", )], {b'foo': b'bla'}) cd[b'a'] = b'b' self.assertEqual(cd[b'a'], b'b')
def test_dict(self): cd = ConfigDict() cd.set((b"core", ), b"foo", b"bla") cd.set((b"core2", ), b"foo", b"bloe") self.assertEqual([(b"core", ), (b"core2", )], list(cd.keys())) self.assertEqual(cd[(b"core", )], {b"foo": b"bla"}) cd[b"a"] = b"b" self.assertEqual(cd[b"a"], b"b")