[3.13] gh-120873: Add tests for new widget options in Tk 8.7 (GH-120877) (GH-120879)

(cherry picked from commit a046c848c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-06-22 15:43:30 +02:00 committed by GitHub
parent 61e6b6ab4a
commit cffead81fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 104 additions and 36 deletions

View file

@ -61,11 +61,11 @@ def test_configure_visual(self):
@add_standard_options(StandardOptionsTests)
class ToplevelTest(AbstractToplevelTest, unittest.TestCase):
OPTIONS = (
'background', 'borderwidth',
'background', 'backgroundimage', 'borderwidth',
'class', 'colormap', 'container', 'cursor', 'height',
'highlightbackground', 'highlightcolor', 'highlightthickness',
'menu', 'padx', 'pady', 'relief', 'screen',
'takefocus', 'use', 'visual', 'width',
'takefocus', 'tile', 'use', 'visual', 'width',
)
def create(self, **kwargs):
@ -104,10 +104,10 @@ def test_configure_use(self):
@add_standard_options(StandardOptionsTests)
class FrameTest(AbstractToplevelTest, unittest.TestCase):
OPTIONS = (
'background', 'borderwidth',
'background', 'backgroundimage', 'borderwidth',
'class', 'colormap', 'container', 'cursor', 'height',
'highlightbackground', 'highlightcolor', 'highlightthickness',
'padx', 'pady', 'relief', 'takefocus', 'visual', 'width',
'padx', 'pady', 'relief', 'takefocus', 'tile', 'visual', 'width',
)
def create(self, **kwargs):
@ -338,7 +338,8 @@ class EntryTest(AbstractWidgetTest, unittest.TestCase):
'highlightbackground', 'highlightcolor', 'highlightthickness',
'insertbackground', 'insertborderwidth',
'insertofftime', 'insertontime', 'insertwidth',
'invalidcommand', 'justify', 'readonlybackground', 'relief',
'invalidcommand', 'justify', 'placeholder', 'placeholderforeground',
'readonlybackground', 'relief',
'selectbackground', 'selectborderwidth', 'selectforeground',
'show', 'state', 'takefocus', 'textvariable',
'validate', 'validatecommand', 'width', 'xscrollcommand',
@ -432,8 +433,8 @@ class SpinboxTest(EntryTest, unittest.TestCase):
'increment',
'insertbackground', 'insertborderwidth',
'insertofftime', 'insertontime', 'insertwidth',
'invalidcommand', 'justify', 'relief', 'readonlybackground',
'repeatdelay', 'repeatinterval',
'invalidcommand', 'justify', 'placeholder', 'placeholderforeground',
'relief', 'readonlybackground', 'repeatdelay', 'repeatinterval',
'selectbackground', 'selectborderwidth', 'selectforeground',
'state', 'takefocus', 'textvariable', 'to',
'validate', 'validatecommand', 'values',
@ -1176,10 +1177,6 @@ class ScrollbarTest(AbstractWidgetTest, unittest.TestCase):
def create(self, **kwargs):
return tkinter.Scrollbar(self.root, **kwargs)
def test_configure_activerelief(self):
widget = self.create()
self.checkReliefParam(widget, 'activerelief')
def test_configure_elementborderwidth(self):
widget = self.create()
self.checkPixelsParam(widget, 'elementborderwidth', 4.3, 5.6, '1m')
@ -1386,6 +1383,7 @@ def test_paneconfigure_width(self):
class MenuTest(AbstractWidgetTest, unittest.TestCase):
OPTIONS = (
'activebackground', 'activeborderwidth', 'activeforeground',
'activerelief',
'background', 'borderwidth', 'cursor',
'disabledforeground', 'font', 'foreground',
'postcommand', 'relief', 'selectcolor', 'takefocus',
@ -1401,6 +1399,8 @@ def test_indexcommand_none(self):
i = widget.index('none')
self.assertIsNone(i)
test_configure_activerelief = requires_tk(8, 7)(StandardOptionsTests.test_configure_activerelief)
def test_configure_postcommand(self):
widget = self.create()
self.checkCommandParam(widget, 'postcommand')