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

Method test_delete_section

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

Source from the content-addressed store, hash-verified

766 # TODO: test that save_all calls usercfg Saves.
767
768 def test_delete_section(self):
769 changes = self.load()
770 changes.delete_section('main', 'fake') # Test no exception.
771 self.assertEqual(changes, self.loaded) # Test nothing deleted.
772 for cfgtype, section in (('main', 'Msec'), ('keys', 'Ksec')):
773 testcfg[cfgtype].SetOption(section, 'name', 'value')
774 changes.delete_section(cfgtype, section)
775 with self.assertRaises(KeyError):
776 changes[cfgtype][section] # Test section gone from changes
777 testcfg[cfgtype][section] # and from mock userCfg.
778 # TODO test for save call.
779
780 def test_clear(self):
781 changes = self.load()

Callers

nothing calls this directly

Calls 5

loadMethod · 0.95
delete_sectionMethod · 0.80
assertEqualMethod · 0.45
SetOptionMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected