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

Method test_keybinding

Lib/idlelib/idle_test/test_configdialog.py:909–928  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

907 self.assertEqual(d.load_keys_list.called, 1)
908
909 def test_keybinding(self):
910 idleConf.SetOption('extensions', 'ZzDummy', 'enable', 'True')
911 d = self.page
912 d.custom_name.set('my custom keys')
913 d.bindingslist.delete(0, 'end')
914 d.bindingslist.insert(0, 'copy')
915 d.bindingslist.insert(1, 'z-in')
916 d.bindingslist.selection_set(0)
917 d.bindingslist.selection_anchor(0)
918 # Core binding - adds to keys.
919 d.keybinding.set('<Key-F11>')
920 self.assertEqual(keyspage,
921 {'my custom keys': {'copy': '<Key-F11>'}})
922
923 # Not a core binding - adds to extensions.
924 d.bindingslist.selection_set(1)
925 d.bindingslist.selection_anchor(1)
926 d.keybinding.set('<Key-F11>')
927 self.assertEqual(extpage,
928 {'ZzDummy_cfgBindings': {'z-in': '<Key-F11>'}})
929
930 def test_set_keys_type(self):
931 eq = self.assertEqual

Callers

nothing calls this directly

Calls 7

selection_anchorMethod · 0.80
SetOptionMethod · 0.45
setMethod · 0.45
deleteMethod · 0.45
insertMethod · 0.45
selection_setMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected