Ejemplo n.º 1
0
def feature_requirements(featlist):
    funcs, cfgs = load()
    all_featcfg = reqmod.valuedict()
    for feat in featlist:
        featcfg = cfgs.get(feat)
        if not featcfg:
            msg.debug('No feature config for feature "%s' % feat)
            continue
        all_featcfg = update_if(all_featcfg, None, **featcfg)
    return all_featcfg
Ejemplo n.º 2
0
def test_update_if():
    start = dict(a=1,b=2, something=None, override=None, keep='lovely')
    end = util.update_if(start, None, b=42, c=69, nothing=None, override='something', keep=None)
    assert len(end) == 7
    assert end['a'] == 1
    assert end['b'] == 42
    assert end['c'] == 69
    assert end['nothing'] is None
    assert end['override'] is 'something'
    assert end['keep'] is 'lovely'
    print (end)