def test_add_to_dict_func_append(): data, path, value, is_leaf_list = leaf_list_append1 _add_to_dict(data, path, value, is_leaf_list) assert is_path_valid(data, path) assert_leaf_list(data, path, is_leaf_list) # we do not want data again as we will re-use the dict for appending _data, path, value, is_leaf_list = leaf_list_append2 _add_to_dict(data, path, value, is_leaf_list) assert is_path_valid(data, path) assert_leaf_list(data, path, is_leaf_list) assert len(value_from_path(data, path)) == 2
def test_add_to_dict_func_path_taken(): data, path, value, is_leaf_list = path_taken with pytest.raises(ValueError): _add_to_dict(data, path, value, is_leaf_list)
def test_add_to_dict_func_leaves(primitive): data, path, value, is_leaf_list = primitive _add_to_dict(data, path, value, is_leaf_list) assert is_path_valid(data, path) assert_leaf_list(data, path, is_leaf_list)