def test_from_flat_dict_with_nested_dict_inits(): d = {'info.attribute': {'nugget'}, 'otherinfo': 'secondnugget'} tr = Trict.from_flat_dict(d) assert tr.data == { 'info': { 'attribute': {'nugget'} }, 'otherinfo': 'secondnugget' }
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