diff options
Diffstat (limited to 'Lib/idlelib/idle_test/test_config_key.py')
-rw-r--r-- | Lib/idlelib/idle_test/test_config_key.py | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py index abe5749..adf02c9 100644 --- a/Lib/idlelib/idle_test/test_config_key.py +++ b/Lib/idlelib/idle_test/test_config_key.py @@ -1,4 +1,4 @@ -"Test config_key, coverage 75%" +"Test config_key, coverage 82%" from idlelib import config_key from test.support import requires @@ -9,15 +9,15 @@ from idlelib.idle_test.mock_tk import Mbox_func class ValidationTest(unittest.TestCase): - "Test validation methods: OK, KeysOK, bind_ok." + "Test validation methods: ok, keys_ok, bind_ok." class Validator(config_key.GetKeysDialog): def __init__(self, *args, **kwargs): config_key.GetKeysDialog.__init__(self, *args, **kwargs) - class listKeysFinal: + class list_keys_final: get = Func() - self.listKeysFinal = listKeysFinal - GetModifiers = Func() + self.list_keys_final = list_keys_final + get_modifiers = Func() showerror = Mbox_func() @classmethod @@ -31,7 +31,7 @@ class ValidationTest(unittest.TestCase): @classmethod def tearDownClass(cls): - cls.dialog.Cancel() + cls.dialog.cancel() cls.root.update_idletasks() cls.root.destroy() del cls.dialog, cls.root @@ -42,49 +42,49 @@ class ValidationTest(unittest.TestCase): # A test that sets a non-blank modifier list should reset it to []. def test_ok_empty(self): - self.dialog.keyString.set(' ') - self.dialog.OK() + self.dialog.key_string.set(' ') + self.dialog.ok() self.assertEqual(self.dialog.result, '') self.assertEqual(self.dialog.showerror.message, 'No key specified.') def test_ok_good(self): - self.dialog.keyString.set('<Key-F11>') - self.dialog.listKeysFinal.get.result = 'F11' - self.dialog.OK() + self.dialog.key_string.set('<Key-F11>') + self.dialog.list_keys_final.get.result = 'F11' + self.dialog.ok() self.assertEqual(self.dialog.result, '<Key-F11>') self.assertEqual(self.dialog.showerror.message, '') def test_keys_no_ending(self): - self.assertFalse(self.dialog.KeysOK('<Control-Shift')) + self.assertFalse(self.dialog.keys_ok('<Control-Shift')) self.assertIn('Missing the final', self.dialog.showerror.message) def test_keys_no_modifier_bad(self): - self.dialog.listKeysFinal.get.result = 'A' - self.assertFalse(self.dialog.KeysOK('<Key-A>')) + self.dialog.list_keys_final.get.result = 'A' + self.assertFalse(self.dialog.keys_ok('<Key-A>')) self.assertIn('No modifier', self.dialog.showerror.message) def test_keys_no_modifier_ok(self): - self.dialog.listKeysFinal.get.result = 'F11' - self.assertTrue(self.dialog.KeysOK('<Key-F11>')) + self.dialog.list_keys_final.get.result = 'F11' + self.assertTrue(self.dialog.keys_ok('<Key-F11>')) self.assertEqual(self.dialog.showerror.message, '') def test_keys_shift_bad(self): - self.dialog.listKeysFinal.get.result = 'a' - self.dialog.GetModifiers.result = ['Shift'] - self.assertFalse(self.dialog.KeysOK('<a>')) + self.dialog.list_keys_final.get.result = 'a' + self.dialog.get_modifiers.result = ['Shift'] + self.assertFalse(self.dialog.keys_ok('<a>')) self.assertIn('shift modifier', self.dialog.showerror.message) - self.dialog.GetModifiers.result = [] + self.dialog.get_modifiers.result = [] def test_keys_dup(self): for mods, final, seq in (([], 'F12', '<Key-F12>'), (['Control'], 'x', '<Control-Key-x>'), (['Control'], 'X', '<Control-Key-X>')): with self.subTest(m=mods, f=final, s=seq): - self.dialog.listKeysFinal.get.result = final - self.dialog.GetModifiers.result = mods - self.assertFalse(self.dialog.KeysOK(seq)) + self.dialog.list_keys_final.get.result = final + self.dialog.get_modifiers.result = mods + self.assertFalse(self.dialog.keys_ok(seq)) self.assertIn('already in use', self.dialog.showerror.message) - self.dialog.GetModifiers.result = [] + self.dialog.get_modifiers.result = [] def test_bind_ok(self): self.assertTrue(self.dialog.bind_ok('<Control-Shift-Key-a>')) |