diff options
author | Ted Gould <ted@canonical.com> | 2009-06-26 14:33:56 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-06-26 14:33:56 -0500 |
commit | 945da10131e3a94bd5b3bedd59602ede7748add4 (patch) | |
tree | 44283590861972b54c3d11f8d53e2636b0f3c0f5 /tests/dbusmenu-gtk/dbusmenu.py.in | |
parent | 9a4f790af45a46e41823bcdb91fde1e87d32af76 (diff) | |
parent | 7675f60a41c7a7fe7a4aa9ed853f005798054111 (diff) | |
download | libdbusmenu-945da10131e3a94bd5b3bedd59602ede7748add4.tar.gz libdbusmenu-945da10131e3a94bd5b3bedd59602ede7748add4.tar.bz2 libdbusmenu-945da10131e3a94bd5b3bedd59602ede7748add4.zip |
Merging in the glibresignaling branch to change how
signals move themselves up the stack.
Diffstat (limited to 'tests/dbusmenu-gtk/dbusmenu.py.in')
-rw-r--r-- | tests/dbusmenu-gtk/dbusmenu.py.in | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/dbusmenu-gtk/dbusmenu.py.in b/tests/dbusmenu-gtk/dbusmenu.py.in new file mode 100644 index 0000000..ce159e1 --- /dev/null +++ b/tests/dbusmenu-gtk/dbusmenu.py.in @@ -0,0 +1,71 @@ +from mago.test_suite.main import SingleApplicationTestSuite +from mago.application.main import Application + +import ldtp, ooldtp, ldtputils + +class DbusMenuGtkApp(): + LAUNCHER = "@srcdir@/dbusMenuTest" + WINDOW = "frmlibdbusmenu-gtktest" + + def open(self, menu_schema=''): + ldtp.launchapp(self.LAUNCHER, [menu_schema]) + + def menu_exists(self, menu=''): + app = ooldtp.context(self.WINDOW) + + if menu == '': + menu = "mnu1" + + try: + component = app.getchild(menu) + except ldtp.LdtpExecutionError: + return False + + return True + + def get_submenus(self, menu=''): + app = ooldtp.context(self.WINDOW) + + if menu == '': + menu = "mnu1" + + component = app.getchild(menu) + + try: + submenus = component.listsubmenus() + except ldtp.LdtpExecutionError: + return "" + + return submenus + +class DbusMenuGtkTest(SingleApplicationTestSuite): + APPLICATION_FACTORY = DbusMenuGtkApp + + def cleanup(self): + ldtp.waittillguinotexist(self.application.WINDOW, guiTimeOut=70) + + def teardown(self): + ldtp.waittillguinotexist(self.application.WINDOW, guiTimeOut=70) + + def testStaticMenu(self, menu_schema, menu_item='', notexists=''): + self.application.open(menu_schema) + ldtp.waittillguiexist(self.application.WINDOW) + + if notexists == "True": + if self.application.menu_exists(menu_item): + raise AssertionError("The menu item exists") + else: + if not self.application.menu_exists(menu_item): + raise AssertionError("The menu item does not exists") + + + def testSubmenus(self, menu_schema, menu_item='', submenus=''): + self.application.open(menu_schema) + ldtp.waittillguiexist(self.application.WINDOW) + + if submenus != self.application.get_submenus(menu_item): + raise AssertionError("The submenus are different") + + + + |