MCPcopy Create free account
hub / github.com/python/cpython / mock_config

Method mock_config

Lib/idlelib/idle_test/test_config.py:207–219  ·  view source on GitHub ↗

Return a mocked idleConf Both default and user config used the same config-*.def

(self)

Source from the content-addressed store, hash-verified

205 return config.IdleConf(_utest=_utest)
206
207 def mock_config(self):
208 """Return a mocked idleConf
209
210 Both default and user config used the same config-*.def
211 """
212 conf = config.IdleConf(_utest=True)
213 for ctype in conf.config_types:
214 conf.defaultCfg[ctype] = config.IdleConfParser('')
215 conf.defaultCfg[ctype].read_string(self.config_string[ctype])
216 conf.userCfg[ctype] = config.IdleUserConfParser('')
217 conf.userCfg[ctype].read_string(self.config_string[ctype])
218
219 return conf
220
221 @unittest.skipIf(sys.platform.startswith('win'), 'this is test for unix system')
222 def test_get_user_cfg_dir_unix(self):

Callers 15

test_get_optionMethod · 0.95
test_set_optionMethod · 0.95
test_get_section_listMethod · 0.95
test_get_highlightMethod · 0.95
test_get_theme_dictMethod · 0.95
test_get_keybindingMethod · 0.95
test_get_keysetMethod · 0.95

Calls 1

read_stringMethod · 0.80

Tested by

no test coverage detected