Beispiel #1
0
def test_read():
    from glob import glob

    path = os.path.join(os.path.dirname(__file__), "data", "*.conf")
    specs = os.path.join(os.path.dirname(__file__), "data", "*.spec")
    for name in glob(path):
        Config.read([name])
    for name in glob(specs):
        Config.read([name])
Beispiel #2
0
def test_write():
    path = os.path.join(os.path.dirname(__file__), "data", "mysqldump.conf")
    cfg = Config.read([path])
    dest = tempfile.mkdtemp()
    try:
        cfg.write(os.path.join(dest, "foo.conf"))
        Config.read([os.path.join(dest, "foo.conf")])
    finally:
        shutil.rmtree(dest)