summaryrefslogtreecommitdiff
path: root/Lib/idlelib/idle_test/test_configdialog.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2017-09-10 20:30:46 -0400
committerGitHub <noreply@github.com>2017-09-10 20:30:46 -0400
commitd6c397bf772a8f17e00afc5e0a2cf37fdebcdf29 (patch)
tree69079c5b189dbc750d6bfa5ddcf489f15508c619 /Lib/idlelib/idle_test/test_configdialog.py
parent28580316a57d1757978196c27286f989d21ec0f3 (diff)
downloadcpython-git-d6c397bf772a8f17e00afc5e0a2cf37fdebcdf29.tar.gz
[3.6] bpo-27099: IDLE - Convert built-in extensions to regular features (GH-2494) (#3487)
About 10 IDLE features were implemented as supposedly optional extensions. Their different behavior could be confusing or worse for users and not good for maintenance. Hence the conversion. The main difference for users is that user configurable key bindings for builtin features are now handled uniformly. Now, editing a binding in a keyset only affects its value in the keyset. All bindings are defined together in the system-specific default keysets in config- extensions.def. All custom keysets are saved as a whole in config- extension.cfg. All take effect as soon as one clicks Apply or Ok. The affected events are '<<force-open-completions>>', '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>', '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not affect their keyset- specific customization after 3.6.3. and vice versa. Inital patch by Charles Wohlganger, revised by Terry Jan Reedy. (cherry picked from commit 58fc71c)
Diffstat (limited to 'Lib/idlelib/idle_test/test_configdialog.py')
-rw-r--r--Lib/idlelib/idle_test/test_configdialog.py43
1 files changed, 34 insertions, 9 deletions
diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py
index f116538fac..3d6a858e6f 100644
--- a/Lib/idlelib/idle_test/test_configdialog.py
+++ b/Lib/idlelib/idle_test/test_configdialog.py
@@ -824,19 +824,20 @@ class KeysPageTest(unittest.TestCase):
d.custom_name.set('my custom keys')
d.bindingslist.delete(0, 'end')
d.bindingslist.insert(0, 'copy')
- d.bindingslist.insert(1, 'expand-word')
+ d.bindingslist.insert(1, 'z-in')
d.bindingslist.selection_set(0)
d.bindingslist.selection_anchor(0)
# Core binding - adds to keys.
d.keybinding.set('<Key-F11>')
self.assertEqual(keyspage,
{'my custom keys': {'copy': '<Key-F11>'}})
+
# Not a core binding - adds to extensions.
d.bindingslist.selection_set(1)
d.bindingslist.selection_anchor(1)
d.keybinding.set('<Key-F11>')
self.assertEqual(extpage,
- {'AutoExpand_cfgBindings': {'expand-word': '<Key-F11>'}})
+ {'ZzDummy_cfgBindings': {'z-in': '<Key-F11>'}})
def test_set_keys_type(self):
eq = self.assertEqual
@@ -1125,13 +1126,6 @@ class GenPageTest(unittest.TestCase):
self.assertEqual(mainpage,
{'General': {'editor-on-startup': '0'}})
- def test_autosave(self):
- d = self.page
- d.save_auto_on.invoke()
- self.assertEqual(mainpage, {'General': {'autosave': '1'}})
- d.save_ask_on.invoke()
- self.assertEqual(mainpage, {'General': {'autosave': '0'}})
-
def test_editor_size(self):
d = self.page
d.win_height_int.insert(0, '1')
@@ -1140,6 +1134,37 @@ class GenPageTest(unittest.TestCase):
d.win_width_int.insert(0, '1')
self.assertEqual(mainpage, {'EditorWindow': {'width': '180'}})
+ def test_autocomplete_wait(self):
+ self.page.auto_wait_int.insert(0, '1')
+ self.assertEqual(extpage, {'AutoComplete': {'popupwait': '12000'}})
+
+ def test_parenmatch(self):
+ d = self.page
+ eq = self.assertEqual
+ d.paren_style_type['menu'].invoke(0)
+ eq(extpage, {'ParenMatch': {'style': 'opener'}})
+ changes.clear()
+ d.paren_flash_time.insert(0, '2')
+ eq(extpage, {'ParenMatch': {'flash-delay': '2500'}})
+ changes.clear()
+ d.bell_on.invoke()
+ eq(extpage, {'ParenMatch': {'bell': 'False'}})
+
+ def test_autosave(self):
+ d = self.page
+ d.save_auto_on.invoke()
+ self.assertEqual(mainpage, {'General': {'autosave': '1'}})
+ d.save_ask_on.invoke()
+ self.assertEqual(mainpage, {'General': {'autosave': '0'}})
+
+ def test_paragraph(self):
+ self.page.format_width_int.insert(0, '1')
+ self.assertEqual(extpage, {'FormatParagraph': {'max-width': '172'}})
+
+ def test_context(self):
+ self.page.context_int.insert(0, '1')
+ self.assertEqual(extpage, {'CodeContext': {'numlines': '13'}})
+
def test_source_selected(self):
d = self.page
d.set = d.set_add_delete_state