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

Method test_builtin_name

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

Source from the content-addressed store, hash-verified

861 del d.var_changed_builtin_name, d.var_changed_custom_name
862
863 def test_builtin_name(self):
864 eq = self.assertEqual
865 d = self.page
866 idleConf.userCfg['main'].remove_section('Keys')
867 item_list = ['IDLE Classic Windows', 'IDLE Classic OSX',
868 'IDLE Modern UNIX']
869
870 # Not in old_keys, defaults name to first item.
871 d.builtinlist.SetMenu(item_list, 'IDLE Modern UNIX')
872 eq(mainpage, {'Keys': {'name': 'IDLE Classic Windows',
873 'name2': 'IDLE Modern UNIX'}})
874 eq(d.keys_message['text'], 'New key set, see Help')
875 eq(d.load_keys_list.called, 1)
876 eq(d.load_keys_list.args, ('IDLE Modern UNIX', ))
877
878 # Not in old keys - uses name2.
879 changes.clear()
880 idleConf.SetOption('main', 'Keys', 'name', 'IDLE Classic Unix')
881 d.builtinlist.SetMenu(item_list, 'IDLE Modern UNIX')
882 eq(mainpage, {'Keys': {'name2': 'IDLE Modern UNIX'}})
883 eq(d.keys_message['text'], 'New key set, see Help')
884 eq(d.load_keys_list.called, 2)
885 eq(d.load_keys_list.args, ('IDLE Modern UNIX', ))
886
887 # Builtin name in old_keys.
888 changes.clear()
889 d.builtinlist.SetMenu(item_list, 'IDLE Classic OSX')
890 eq(mainpage, {'Keys': {'name': 'IDLE Classic OSX', 'name2': ''}})
891 eq(d.keys_message['text'], '')
892 eq(d.load_keys_list.called, 3)
893 eq(d.load_keys_list.args, ('IDLE Classic OSX', ))
894
895 def test_custom_name(self):
896 d = self.page

Callers

nothing calls this directly

Calls 5

eqFunction · 0.85
remove_sectionMethod · 0.80
SetMenuMethod · 0.80
clearMethod · 0.45
SetOptionMethod · 0.45

Tested by

no test coverage detected