Lines Matching defs:config
1 """Test config, coverage 93%.
6 from idlelib import config
21 idleConf = config.idleConf
24 usermain = testcfg['main'] = config.IdleUserConfParser('')
25 userhigh = testcfg['highlight'] = config.IdleUserConfParser('')
26 userkeys = testcfg['keys'] = config.IdleUserConfParser('')
27 userextn = testcfg['extensions'] = config.IdleUserConfParser('')
41 config = """
54 parser = config.IdleConfParser('')
55 parser.read_string(self.config)
75 parser = config.IdleConfParser('')
76 parser.read_string(self.config)
83 parser = config.IdleConfParser('')
90 parser = config.IdleConfParser(config_path)
101 return config.IdleUserConfParser(path)
169 # Should save to path when config is not empty.
174 # Should remove the file from disk when config is empty.
187 conf = config.IdleConf(_utest=True)
193 config_path = os.path.join(idle_dir, '../config-%s.def' % ctype)
197 cls.orig_warn = config._warn
198 config._warn = Func()
202 config._warn = cls.orig_warn
205 return config.IdleConf(_utest=_utest)
210 Both default and user config used the same config-*.def
212 conf = config.IdleConf(_utest=True)
214 conf.defaultCfg[ctype] = config.IdleConfParser('')
216 conf.userCfg[ctype] = config.IdleUserConfParser('')
223 # Test to get user config directory under unix.
246 # Test to get user config directory under Windows.
282 self.assertIsInstance(default_parser, config.IdleConfParser)
284 self.assertIsInstance(user_parser, config.IdleUserConfParser)
286 # Check config path are correct
289 os.path.join(idle_dir, f'config-{cfg_type}.def'))
292 os.path.join(conf.userdir or '#', f'config-{cfg_type}.cfg'))
299 conf.defaultCfg['foo'] = config.IdleConfParser(config_path)
300 conf.userCfg['foo'] = config.IdleUserConfParser(config_path)
302 # Load all config from path
318 with mock.patch('idlelib.config.IdleUserConfParser.Save') as m:
328 with mock.patch('idlelib.config._warn') as _warn:
352 with self.assertRaises(config.InvalidConfigSet):
354 with self.assertRaises(config.InvalidConfigType):
371 with mock.patch('idlelib.config._warn'):
384 with self.assertRaises(config.InvalidTheme):
500 # Above depended on config-extensions.def having Alt keys,
519 # XXX: Should move out the core keys to config file or other place
535 with self.assertRaises(config.InvalidConfigSet):
541 # Add help source to user config
590 """ Test colorkeys function with user config [Theme] and [Keys] patterns.
592 colorkeys = config.IdleConf.current_colors_and_keys
717 self.changes = config.ConfigChanges()
790 config._warned = set()
792 config._warn('warning', 'key')
793 Equal(config._warned, {('warning','key')})
796 config._warn('warning', 'key')
799 config._warn('warn2', 'yek')
800 Equal(config._warned, {('warning','key'), ('warn2','yek')})