def test_flatten_flats(): tr = Trict(base_dict()) old_data = copy.deepcopy(tr.data) assert tr.flatten() == { 'user.information.attribute': 'infonugget', 'user.information.another_attribute': 'secondnugget', 'user.moreinformation': 'extranugget' } assert tr.data == old_data
def test_from_flat_dict_inits(): tr = Trict(base_dict()) flat = tr.flatten() new_tr = Trict.from_flat_dict(flat) assert new_tr.data == tr.data