k_list = k.split(".")
k_item_prev = k_list[0]
populated = False
+ if k_item_prev not in db_nested and populate:
+ populated = True
+ db_nested[k_item_prev] = None
for k_item in k_list[1:]:
if isinstance(db_nested[k_item_prev], dict):
if k_item not in db_nested[k_item_prev]:
({"a": [[4]]}, {"a.0.0": "v"}, {"a": [["v"]]}, "set nested list"),
({"a": [[4]]}, {"a.0.2": "v"}, {"a": [[4, None, "v"]]}, "expand nested list"),
({"a": [[4]]}, {"a.2.2": "v"}, {"a": [[4], None, {"2": "v"}]}, "expand list and add number key"),
+ ({"a": None}, {"b.c": "v"}, {"a": None, "b": {"c": "v"}}, "expand at root"),
)
db_men = DbMemory()
db_men._find = Mock()