def main(source, dest):
    dest = os.path.abspath(dest)
    if not os.path.isfile(source):
        raise SystemExit("Error: Source (%s) is not a file" % source)
    if os.path.exists(dest):
        raise SystemExit("Error: Destination path (%s) already exists" % dest)
    old_config = manager.read_raw(source)
    manager.create_new_config(dest, old_config)
def main(source, dest):
    dest = os.path.abspath(dest)
    if not os.path.isfile(source):
        raise SystemExit("Error: Source (%s) is not a file" % source)
    if os.path.exists(dest):
        raise SystemExit("Error: Destination path (%s) already exists" % dest)
    old_config = manager.read_raw(source)
    manager.create_new_config(dest, old_config)
Пример #3
0
 def test_read_raw_write_raw(self):
     content = "Some string"
     manager.write_raw(self.filename, content)
     actual = manager.read_raw(self.filename)
     assert_equal(content, actual)
Пример #4
0
 def test_read_raw_write_raw(self):
     content = "Some string"
     manager.write_raw(self.filename, content)
     actual = manager.read_raw(self.filename)
     assert_equal(content, actual)
Пример #5
0
 def test_read_raw_write_raw(self):
     filename = tempfile.NamedTemporaryFile().name
     content = "Some string"
     manager.write_raw(filename, content)
     actual = manager.read_raw(filename)
     assert_equal(content, actual)