Skip to content

Commit d6e2147

Browse files
Test that existing case variants are not duplicated
1 parent 3cf65a5 commit d6e2147

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎Lib/idlelib/idle_test/test_editor.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ def test_apply_bindings_caps_lock(self):
3737
e = Editor(root=self.root)
3838
try:
3939
e.apply_bindings({'<<spam>>': ('<Control-Key-s>', '<Key-F1>'),
40-
'<<eggs>>': ('<Control-Key-x><Alt-Shift-Key-S>',)})
40+
'<<eggs>>': ('<Control-Key-x><Alt-Shift-Key-S>',),
41+
'<<ham>>': ('<Control-Key-h>', '<Control-Key-H>')})
4142
self.assertEqual(set(e.text.event_info('<<spam>>')),
4243
{'<Control-KeyPress-s>', '<Control-KeyPress-S>',
4344
'<KeyPress-F1>'})
45+
# Existing variants are not added again.
46+
self.assertEqual(e.text.event_info('<<ham>>'),
47+
('<Control-KeyPress-h>', '<Control-KeyPress-H>'))
4448
self.assertEqual(set(e.text.event_info('<<eggs>>')),
4549
{'<Control-Key-x><Shift-Alt-Key-S>',
4650
'<Control-Key-X><Shift-Alt-Key-s>'})

0 commit comments

Comments
 (0)