33License: GNU GPLv3
44Source: This repository
55"""
6- from ttkwidgets .frames import Balloon
6+ from ttkwidgets .frames import Tooltip
77from ttkwidgets .utilities import parse_geometry_string
88from tests import BaseWidgetTest
99try :
1313from time import sleep
1414
1515
16- class TestBalloon (BaseWidgetTest ):
16+ class TestTooltip (BaseWidgetTest ):
1717 def test_balloon_init (self ):
18- balloon = Balloon (self .window )
18+ balloon = Tooltip (self .window )
1919 self .window .update ()
2020
2121 def test_balloon_kwargs (self ):
22- balloon = Balloon (self .window , headertext = "Help" , text = "This is a test for the Balloon widget." , width = 300 ,
22+ balloon = Tooltip (self .window , headertext = "Help" , text = "This is a test for the Tooltip widget." , width = 300 ,
2323 timeout = 2 , background = "white" , showheader = True , offset = (20 , 20 ), static = True )
2424 self .assertEqual (balloon .cget ("headertext" ), "Help" )
25- self .assertEqual (balloon .cget ("text" ), "This is a test for the Balloon widget." )
25+ self .assertEqual (balloon .cget ("text" ), "This is a test for the Tooltip widget." )
2626 self .assertEqual (balloon .cget ("width" ), 300 )
2727 self .assertEqual (balloon .cget ("timeout" ), 2 )
2828 self .assertEqual (balloon .cget ("background" ), "white" )
2929
30- balloon .config (headertext = "New Help" , text = "This is another test for the Balloon widget." , width = 400 ,
30+ balloon .config (headertext = "New Help" , text = "This is another test for the Tooltip widget." , width = 400 ,
3131 timeout = 3 , background = "black" )
3232 self .assertEqual (balloon ["headertext" ], "New Help" )
33- self .assertEqual (balloon ["text" ], "This is another test for the Balloon widget." )
33+ self .assertEqual (balloon ["text" ], "This is another test for the Tooltip widget." )
3434 self .assertEqual (balloon ["width" ], 400 )
3535 self .assertEqual (balloon ["timeout" ], 3 )
3636 self .assertEqual (balloon ["background" ], "black" )
@@ -70,7 +70,7 @@ def test_balloon_kwargs(self):
7070 self .assertFalse (x2 == x3 or y2 == y3 )
7171
7272 def test_balloon_show (self ):
73- balloon = Balloon (self .window )
73+ balloon = Tooltip (self .window )
7474 self .window .update ()
7575 balloon .show ()
7676 self .window .update ()
@@ -82,7 +82,7 @@ def test_balloon_show(self):
8282 self .assertIs (balloon ._toplevel , None )
8383
8484 def test_balloon_events (self ):
85- balloon = Balloon (self .window , timeout = 0.2 )
85+ balloon = Tooltip (self .window , timeout = 0.2 )
8686 balloon ._on_enter (None )
8787 self .window .update ()
8888 sleep (0.3 )
@@ -92,6 +92,6 @@ def test_balloon_events(self):
9292 self .assertIs (balloon ._toplevel , None )
9393
9494 def test_balloon_events_noshow (self ):
95- balloon = Balloon (self .window )
95+ balloon = Tooltip (self .window )
9696 balloon ._on_enter (None )
9797 balloon ._on_leave (None )
0 commit comments