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])
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)