def test_constructFromDict(self): pydict = {"a": 1, "b": None, "c": True, False: 5.678} d = ImmutableDict(pydict) self.assertEqual(set(d.items()), set(pydict.items()))
def test_iter(self): d = ImmutableDict().set("foo", 1).set("bar", 2) self.assertEqual(set(d), {"foo", "bar"}) self.assertEqual(set(d.keys()), {"foo", "bar"}) self.assertEqual(set(d.values()), {1, 2}) self.assertEqual(set(d.items()), {("foo", 1), ("bar", 2)})