Exemple #1
0
def test_envmunge():
    cfgs = glob('%s/*.cfg'%example_dir)
    print ('Using config files: %s' % str(cfgs))
    suite = deconf.load(cfgs,
                        formatter = deconf.example_formatter)
    pp.pprint(suite)

    cfg = FakeCfg()
    envmunge.decompose(cfg, suite)
    pp.pprint(cfg.env.__dict__)
Exemple #2
0
def test_envmunge():
    cfgs = glob(os.path.join(common.example_dir,'simple','*.cfg'))
    assert cfgs
    print ('Using config files: %s' % str(cfgs))
    suite = deconf.load(cfgs)
    pp.pprint(suite)

    cfg = FakeCfg()
    envmunge.decompose(cfg, suite)
    pp.pprint(cfg.env.__dict__)
Exemple #3
0
def test_export():
    'Test the export_ mechanism'
    suite = deconf.load(os.path.join(example_dir, 'test_envmunge.cfg'),
                        formatter = deconf.example_formatter)
    cfg = FakeCfg()
    envmunge.decompose(cfg, suite)
    for pkg,env in cfg.__dict__.items():
        if pkg == 'env': continue
        me = env.__dict__['munged_env']
        for var in ['PATH','ENVMUNGE','GROUP','PACKAGE']:
            print ('PKGENV:', pkg, var, me.get(var,"(not set)"))
Exemple #4
0
def test_envmunger():
    cfgs = glob('%s/test_envmunge.cfg'%example_dir)
    print ('Using config files: %s' % str(cfgs))
    suite = deconf.load(cfgs,
                        formatter = deconf.example_formatter)
    pp.pprint(suite)

    cfg = FakeCfg()
    envmunge.decompose(cfg, suite)
    newenv = cfg.env.envmunger(os.environ)
    for var,newv in sorted(newenv.items()):
        oldv = os.environ.get(var,'')
        if newv == oldv:
            continue
        print ('%s: "%s" --> "%s"' % (var, oldv, newv))