@mock.patch('conf.GCONF_FILE', tempfile.NamedTemporaryFile().name)
@mock.patch('conf.DB_FILE', tempfile.NamedTemporaryFile().name)
def test_update_env():
    try:
        conf.update_env('test')
        with open(conf.GCONF_FILE) as fin:
            gconf = fin.read()
            assert '"env": "test"' in gconf
            assert 'db_root": "/tmp/tmp' in gconf
        with open(conf.DB_FILE) as fin:
            dbconf = fin.read()
            assert 'directory=/tmp/tmp' in dbconf
            assert 'daemon' in dbconf
    finally:
        util.delete_it(conf.get('db_root'))
        util.delete_it(conf.GCONF_FILE)
        util.delete_it(conf.DB_FILE)
dataset/ETHPy150Open starcraftman/new-awesome/test/test_conf.py/test_update_env/original