From 31b242459cef0835057f08c8756559b3261aa8ff Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 11 Sep 2017 13:34:11 -0700 Subject: [PATCH] [3.6] bpo-31414: IDLE -- fix tk entry box tests by deleting first. (GH-3501) (#3502) Adding to an int entry is not the same as deleting and inserting because int('') will fail. (cherry picked from commit 667522efa8fedfb57fd89d7335d7dfd270f274d5) --- Lib/idlelib/idle_test/test_configdialog.py | 28 +++++++++++-------- .../2017-09-11-15-46-05.bpo-31414.wiepgK.rst | 2 ++ 2 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 Misc/NEWS.d/next/IDLE/2017-09-11-15-46-05.bpo-31414.wiepgK.rst diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py index 3d6a858e6fd..cae7186415b 100644 --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -1128,15 +1128,18 @@ class GenPageTest(unittest.TestCase): def test_editor_size(self): d = self.page - d.win_height_int.insert(0, '1') - self.assertEqual(mainpage, {'EditorWindow': {'height': '140'}}) + d.win_height_int.delete(0, 'end') + d.win_height_int.insert(0, '11') + self.assertEqual(mainpage, {'EditorWindow': {'height': '11'}}) changes.clear() - d.win_width_int.insert(0, '1') - self.assertEqual(mainpage, {'EditorWindow': {'width': '180'}}) + d.win_width_int.delete(0, 'end') + d.win_width_int.insert(0, '11') + self.assertEqual(mainpage, {'EditorWindow': {'width': '11'}}) def test_autocomplete_wait(self): - self.page.auto_wait_int.insert(0, '1') - self.assertEqual(extpage, {'AutoComplete': {'popupwait': '12000'}}) + self.page.auto_wait_int.delete(0, 'end') + self.page.auto_wait_int.insert(0, '11') + self.assertEqual(extpage, {'AutoComplete': {'popupwait': '11'}}) def test_parenmatch(self): d = self.page @@ -1144,8 +1147,9 @@ class GenPageTest(unittest.TestCase): 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'}}) + d.paren_flash_time.delete(0, 'end') + d.paren_flash_time.insert(0, '11') + eq(extpage, {'ParenMatch': {'flash-delay': '11'}}) changes.clear() d.bell_on.invoke() eq(extpage, {'ParenMatch': {'bell': 'False'}}) @@ -1158,12 +1162,14 @@ class GenPageTest(unittest.TestCase): 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'}}) + self.page.format_width_int.delete(0, 'end') + self.page.format_width_int.insert(0, '11') + self.assertEqual(extpage, {'FormatParagraph': {'max-width': '11'}}) def test_context(self): + self.page.context_int.delete(0, 'end') self.page.context_int.insert(0, '1') - self.assertEqual(extpage, {'CodeContext': {'numlines': '13'}}) + self.assertEqual(extpage, {'CodeContext': {'numlines': '1'}}) def test_source_selected(self): d = self.page diff --git a/Misc/NEWS.d/next/IDLE/2017-09-11-15-46-05.bpo-31414.wiepgK.rst b/Misc/NEWS.d/next/IDLE/2017-09-11-15-46-05.bpo-31414.wiepgK.rst new file mode 100644 index 00000000000..aa49d882d0a --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2017-09-11-15-46-05.bpo-31414.wiepgK.rst @@ -0,0 +1,2 @@ +IDLE -- fix tk entry box tests by deleting first. Adding to an int entry is +not the same as deleting and inserting because int('') will fail.