Tests fro tree_to_dict