Пример #1
0
 def test_set__delimited_string_key_param(self):
     a = NestedDict()
     a.set(("k1", "k2", "k3"), "v")
     self.assertEqual(a, {"k1": {"k2": {"k3": "v"}}})
Пример #2
0
 def test_set__raises_TypeError(self):
     a = NestedDict({"k1": {"k2": "v"}})
     with self.assertRaises(TypeError):
         a.set(("k1", "k2", "k3"), "v", create=False)
Пример #3
0
 def test_set__string_arg(self):
     a = NestedDict()
     a.set("k", "v")
     self.assertEqual(a, {"k": "v"})