def test_set__delimited_string_key_param(self): a = NestedDict() a.set(("k1", "k2", "k3"), "v") self.assertEqual(a, {"k1": {"k2": {"k3": "v"}}})
def test_set__raises_TypeError(self): a = NestedDict({"k1": {"k2": "v"}}) with self.assertRaises(TypeError): a.set(("k1", "k2", "k3"), "v", create=False)
def test_set__string_arg(self): a = NestedDict() a.set("k", "v") self.assertEqual(a, {"k": "v"})