def test_save_load_no_cfg_file_given(self): """ test that in case no cfg dir has been set, the default location is being used and values changed at runtime are used afterwards.""" # replace a value with a non default value: with TemporaryDirectory() as td: os.environ['PYEMMA_CFG_DIR'] = td self.config_inst = pyemma.config() self.config_inst.show_progress_bars = not self.config_inst.show_progress_bars self.config_inst.save() supposed_to_use_cfg = os.path.join(td, self.config_inst.DEFAULT_CONFIG_FILE_NAME) cfg = configparser.RawConfigParser() cfg.read(supposed_to_use_cfg) self.assertEqual(cfg.getboolean('pyemma', 'show_progress_bars'), self.config_inst.show_progress_bars)
def setUp(self): self.config_inst = pyemma.config()