MCPcopy Index your code
hub / github.com/python/cpython / test_load_cfg_files

Method test_load_cfg_files

Lib/idlelib/idle_test/test_config.py:294–313  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

292 os.path.join(conf.userdir or '#', f'config-{cfg_type}.cfg'))
293
294 def test_load_cfg_files(self):
295 conf = self.new_config(_utest=True)
296
297 # Borrow test/configdata/cfgparser.1 from test_configparser.
298 config_path = findfile('cfgparser.1', subdir='configdata')
299 conf.defaultCfg['foo'] = config.IdleConfParser(config_path)
300 conf.userCfg['foo'] = config.IdleUserConfParser(config_path)
301
302 # Load all config from path
303 conf.LoadCfgFiles()
304
305 eq = self.assertEqual
306
307 # Check defaultCfg is loaded
308 eq(conf.defaultCfg['foo'].Get('Foo Bar', 'foo'), 'newbar')
309 eq(conf.defaultCfg['foo'].GetOptionList('Foo Bar'), ['foo'])
310
311 # Check userCfg is loaded
312 eq(conf.userCfg['foo'].Get('Foo Bar', 'foo'), 'newbar')
313 eq(conf.userCfg['foo'].GetOptionList('Foo Bar'), ['foo'])
314
315 def test_save_user_cfg_files(self):
316 conf = self.mock_config()

Callers

nothing calls this directly

Calls 6

new_configMethod · 0.95
findfileFunction · 0.90
eqFunction · 0.85
LoadCfgFilesMethod · 0.80
GetMethod · 0.80
GetOptionListMethod · 0.80

Tested by

no test coverage detected