mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
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>
This commit is contained in:
parent
f82262b186
commit
42d5a4fc3b
3 changed files with 73 additions and 118 deletions
|
|
@ -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):
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
@ -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'}})
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue