def bool_fixt(tmpdir, request): path = os.path.join(tmpdir.__str__(), "conf.conf") with open(path, "w") as fp: fp.write("tag = {}".format(request.param.data)) return BoolFixt(config.Config(path), request.param.result)
def get_conf(): global conf if not conf: conf = config.Config(CONF_PATH, defaults={ 'enable_appliance_mode': 'true', 'primary_wifi_device': '', }) return conf
def conf_fxt(tmpdir): path = os.path.join(tmpdir.__str__(), "conf.conf") with open(path, 'w') as fp: fp.write( textwrap.dedent(""" # # comment # tag1=val1 tag2: val2 tag3 = val3 # tag4 = val4 """)) return config.Config(path)
def load_data(): conf = config.Config( CONF_PATH, defaults={ 'base_name': 'comitup', 'web_service': '', 'external_callback': '/usr/local/bin/comitup-callback', }, ) data = persist.persist( PERSIST_PATH, {'id': str(random.randrange(1000, 9999))}, ) return (conf, data)
def dual_enabled(): conf = config.Config(CONF_PATH, defaults={'enable_appliance_mode': 'true'}) return conf.enable_appliance_mode == 'true'