Skip to content

Commit

Permalink
[STUDIO] Add menu backward-compatibility test
Browse files Browse the repository at this point in the history
  • Loading branch information
ObaraEmmanuel committed Nov 1, 2024
1 parent 1ea139e commit bb18248
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions formation/tests/samples/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,11 @@
<command menu:compound="none" menu:label="command_3" menu:state="normal"/>
</tkinter.Menu>
</tkinter.ttk.Menubutton>
<tkinter.ttk.Menubutton name="menubutton_4" attr:text="menubutton_3" layout:width="185" layout:height="25" layout:x="63" layout:y="209" layout:bordermode="outside">
<tkinter.Menu name="menu_55" attr:activeborderwidth="1" attr:borderwidth="1" attr:font="{Segoe UI} 9">
<command menu:compound="none" menu:label="command_1" menu:state="normal"/>
<command menu:compound="none" menu:label="command_2" menu:state="normal"/>
<command menu:compound="none" menu:label="command_3" menu:state="normal"/>
</tkinter.Menu>
</tkinter.ttk.Menubutton>
</tkinter.Tk>
5 changes: 4 additions & 1 deletion formation/tests/test_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ def test_command_binding(self):

def test_old_format_backwards_compatibility(self):
mb3 = self.builder.menubutton_3
self.assertIsInstance(mb3.nametowidget(mb3.cget("menu")), tkinter.Menu)
mb4 = self.builder.menubutton_4
menu55 = self.builder.menu_55
self.assertIsInstance(mb3.nametowidget(mb3.cget("menu")), tkinter.Menu)
self.assertNotEqual(mb4.nametowidget(mb4.cget("menu")), menu55)

0 comments on commit bb18248

Please sign in to comment.