def read_config(config_file: str): from glados import GladosConfig logging.debug(f"Reading GLaDOS config from {config_file}") config = GladosConfig(config_file) config.read_config() return config
def test_reading_glados_config_datastore(): gc = GladosConfig(GLADOS_CONFIG_FILE) gc.read_config() assert gc.config.datastore.host == POSTGRES_HOST assert gc.sections == GLADOS_CONFIG_SECTIONS assert gc.config.glados.import_bots is True
def test_bad_config_file_path(): gc = GladosConfig("blah.yaml") try: gc.read_config() except Exception as e: assert type(e) is FileNotFoundError
def test_reading_glados_config(): gc = GladosConfig(GLADOS_CONFIG_FILE) gc.read_config() assert gc.sections == GLADOS_CONFIG_SECTIONS assert gc.config.glados.import_bots is True
def read_config(config_file: str = "glados.yaml"): logging.debug(f"importing config from: {config_file}") config = GladosConfig(config_file) config.read_config() return config