diff options
author | Mark Roseman <mark@markroseman.com> | 2021-06-10 19:13:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 19:13:55 (GMT) |
commit | 42d5a4fc3b35e45cdd237d56a04e98894d0a31f5 (patch) | |
tree | ca275169b4bc471dd11a0d8589b8631d41d48422 /Lib/idlelib/idle_test | |
parent | f82262b186c4aa944d2ab0a5468724dfca2ecc3d (diff) | |
download | cpython-42d5a4fc3b35e45cdd237d56a04e98894d0a31f5.zip cpython-42d5a4fc3b35e45cdd237d56a04e98894d0a31f5.tar.gz cpython-42d5a4fc3b35e45cdd237d56a04e98894d0a31f5.tar.bz2 |
bpo-33962: Use ttk spinbox for IDLE indent space config (GH-22954)
If ttk.Spinbox is not available (Tk < 8.5.9) use readonly ttk.Combobox.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_configdialog.py | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py index f71d1b1..3005ce0 100644 --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -73,13 +73,13 @@ class ButtonTest(unittest.TestCase): def test_click_apply(self): d = dialog deactivate = d.deactivate_current_config = mock.Mock() - save_ext = d.save_all_changed_extensions = mock.Mock() + save_ext = d.extpage.save_all_changed_extensions = mock.Mock() activate = d.activate_config_changes = mock.Mock() d.buttons['Apply'].invoke() deactivate.assert_called_once() save_ext.assert_called_once() activate.assert_called_once() - del d.save_all_changed_extensions + del d.extpage.save_all_changed_extensions del d.activate_config_changes, d.deactivate_current_config def test_click_cancel(self): @@ -260,27 +260,6 @@ class FontPageTest(unittest.TestCase): d.set_samples = Func() # Re-mask for other tests. -class IndentTest(unittest.TestCase): - - @classmethod - def setUpClass(cls): - cls.page = dialog.fontpage - cls.page.update() - - def test_load_tab_cfg(self): - d = self.page - d.space_num.set(16) - d.load_tab_cfg() - self.assertEqual(d.space_num.get(), 4) - - def test_indent_scale(self): - d = self.page - changes.clear() - d.indent_scale.set(20) - self.assertEqual(d.space_num.get(), 16) - self.assertEqual(mainpage, {'Indent': {'num-spaces': '16'}}) - - class HighPageTest(unittest.TestCase): """Test that highlight tab widgets enable users to make changes. @@ -1250,6 +1229,12 @@ class WinPageTest(unittest.TestCase): d.win_width_int.insert(0, '11') self.assertEqual(mainpage, {'EditorWindow': {'width': '11'}}) + def test_indent_spaces(self): + d = self.page + d.indent_chooser.set(6) + self.assertEqual(d.indent_spaces.get(), '6') + self.assertEqual(mainpage, {'Indent': {'num-spaces': '6'}}) + def test_cursor_blink(self): self.page.cursor_blink_bool.invoke() self.assertEqual(mainpage, {'EditorWindow': {'cursor-blink': 'False'}}) @@ -1278,7 +1263,7 @@ class WinPageTest(unittest.TestCase): self.assertEqual(extpage, {'FormatParagraph': {'max-width': '11'}}) -class GenPageTest(unittest.TestCase): +class ShedPageTest(unittest.TestCase): """Test that shed tab widgets enable users to make changes. Test that widget actions set vars, that var changes add |