コード例 #1
0
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'
    }
コード例 #2
0
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