5
5
import sys
6
6
7
7
from test .test_ttk_textonly import MockTclObj
8
- from test .test_tkinter .support import (AbstractTkTest , tk_version , get_tk_patchlevel ,
9
- simulate_mouse_click , AbstractDefaultRootTest )
8
+ from test .test_tkinter .support import (
9
+ AbstractTkTest , requires_tk , tk_version , get_tk_patchlevel ,
10
+ simulate_mouse_click , AbstractDefaultRootTest )
10
11
from test .test_tkinter .widget_tests import (add_standard_options ,
11
12
AbstractWidgetTest , StandardOptionsTests , IntegerSizeTests , PixelSizeTests )
12
13
@@ -44,6 +45,10 @@ def padding_conv(value):
44
45
self .checkParam (widget , 'padding' , ('5p' , '6p' , '7p' , '8p' ))
45
46
self .checkParam (widget , 'padding' , (), expected = '' )
46
47
48
+ def test_configure_state (self ):
49
+ widget = self .create ()
50
+ self .checkParams (widget , 'state' , 'active' , 'disabled' , 'readonly' )
51
+
47
52
def test_configure_style (self ):
48
53
widget = self .create ()
49
54
self .assertEqual (widget ['style' ], '' )
@@ -183,10 +188,6 @@ def test_configure_compound(self):
183
188
widget = self .create ()
184
189
self .checkEnumParam (widget , 'compound' , * values , allow_empty = True )
185
190
186
- def test_configure_state (self ):
187
- widget = self .create ()
188
- self .checkParams (widget , 'state' , 'active' , 'disabled' , 'normal' )
189
-
190
191
def test_configure_width (self ):
191
192
widget = self .create ()
192
193
self .checkParams (widget , 'width' , 402 , - 402 , 0 )
@@ -359,11 +360,6 @@ def test_configure_show(self):
359
360
self .checkParam (widget , 'show' , '' )
360
361
self .checkParam (widget , 'show' , ' ' )
361
362
362
- def test_configure_state (self ):
363
- widget = self .create ()
364
- self .checkParams (widget , 'state' ,
365
- 'disabled' , 'normal' , 'readonly' )
366
-
367
363
def test_configure_validate (self ):
368
364
widget = self .create ()
369
365
self .checkEnumParam (widget , 'validate' ,
@@ -803,7 +799,7 @@ def test_configure_menu(self):
803
799
class ScaleTest (AbstractWidgetTest , unittest .TestCase ):
804
800
OPTIONS = (
805
801
'class' , 'command' , 'cursor' , 'from' , 'length' ,
806
- 'orient' , 'style' , 'takefocus' , 'to' , 'value' , 'variable' ,
802
+ 'orient' , 'state' , ' style' , 'takefocus' , 'to' , 'value' , 'variable' ,
807
803
)
808
804
_conv_pixels = False
809
805
default_orient = 'horizontal'
@@ -825,6 +821,8 @@ def test_configure_length(self):
825
821
widget = self .create ()
826
822
self .checkPixelsParam (widget , 'length' , 130 , 131.2 , 135.6 , '5i' )
827
823
824
+ test_configure_state = requires_tk (8 , 6 , 9 )(StandardTtkOptionsTests .test_configure_state )
825
+
828
826
def test_configure_to (self ):
829
827
widget = self .create ()
830
828
self .checkFloatParam (widget , 'to' , 300 , 14.9 , 15.1 , - 10 , conv = False )
0 commit comments