gh-78143: IDLE - replace config dlg scale with ttk spinbox by roseman · Pull Request #22954 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 62 additions & 94 deletions Lib/idlelib/configdialog.py
33 changes: 9 additions & 24 deletions Lib/idlelib/idle_test/test_configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ def test_click_ok(self):
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):
Expand Down Expand Up @@ -260,27 +260,6 @@ def test_set_samples(self):
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.

Expand Down Expand Up @@ -1250,6 +1229,12 @@ def test_editor_size(self):
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'}})
Expand Down Expand Up @@ -1278,7 +1263,7 @@ def test_paragraph(self):
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
Expand Down