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

Method test_get_option

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

Source from the content-addressed store, hash-verified

320 self.assertEqual(m.call_count, len(conf.userCfg))
321
322 def test_get_option(self):
323 conf = self.mock_config()
324
325 eq = self.assertEqual
326 eq(conf.GetOption('main', 'EditorWindow', 'width'), '80')
327 eq(conf.GetOption('main', 'EditorWindow', 'width', type='int'), 80)
328 with mock.patch('idlelib.config._warn') as _warn:
329 eq(conf.GetOption('main', 'EditorWindow', 'font', type='int'), None)
330 eq(conf.GetOption('main', 'EditorWindow', 'NotExists'), None)
331 eq(conf.GetOption('main', 'EditorWindow', 'NotExists', default='NE'), 'NE')
332 eq(_warn.call_count, 4)
333
334 def test_set_option(self):
335 conf = self.mock_config()

Callers

nothing calls this directly

Calls 3

mock_configMethod · 0.95
eqFunction · 0.85
GetOptionMethod · 0.80

Tested by

no test coverage detected