コード例 #1
0
 def test_defaults_are_not_written(self):
     """
     default values are not written to config file
     """
     fd, path = mkstemp()
     config = Config(path=path)
     config.set("option", "value")
     config.save()
     with open(path) as f:
         assert f.read() == "[general]\noption = value\n\n"
コード例 #2
0
ファイル: cli.py プロジェクト: lucaspressi1/feast
def config_set(prop, value):
    """
    Set a Feast properties for the currently active configuration
    """
    try:
        conf = Config()
        conf.set(option=prop.strip(), value=value.strip())
        conf.save()
    except Exception as e:
        _logger.error("Error in reading config file")
        _logger.exception(e)
        sys.exit(1)