def test_push__create_False__raises_TypeError(self):
     a = NestedDict({"k": "v"})
     with self.assertRaises(AttributeError):
         a.push("k", "v", create=False)
 def test_push__create_False__raises_KeyError(self):
     a = NestedDict()
     with self.assertRaises(KeyError):
         a.push("k", "v", create=False)
 def test_push__create_True__creates_list(self):
     a = NestedDict()
     a.push("k", "v")
     self.assertEqual(a, {"k": ["v"]})
 def test_push__path_arg(self):
     a = NestedDict({"k1": {"k2": {"k3": []}}})
     a.push(("k1", "k2", "k3"), "v")
     self.assertEqual(a, {"k1": {"k2": {"k3": ["v"]}}})
 def test_push__string_arg__convert_existing_value(self):
     a = NestedDict({"k": "v"})
     a.push("k", "v")
     self.assertEqual(a, {"k": ["v", "v"]})
 def test_push__string_arg(self):
     a = NestedDict({"k": []})
     a.push("k", "v")
     self.assertEqual(a, {"k": ["v"]})