diff options
| author | Ted Gould <ted@canonical.com> | 2009-10-09 12:06:56 -0400 |
|---|---|---|
| committer | Ted Gould <ted@canonical.com> | 2009-10-09 12:06:56 -0400 |
| commit | dce80730186bfb61b1919652d71fc249b8df5f75 (patch) | |
| tree | 4b73ccf17a97ffe3c0d66d1376360fd4e0430c76 /tests/dbusmenu-gtk/dbusmenu.py.in | |
| parent | 1e668b013089c5a4027102bca75f7542917fef2d (diff) | |
| download | libdbusmenu-dce80730186bfb61b1919652d71fc249b8df5f75.tar.gz libdbusmenu-dce80730186bfb61b1919652d71fc249b8df5f75.tar.bz2 libdbusmenu-dce80730186bfb61b1919652d71fc249b8df5f75.zip | |
Making the mago tests run in the make file in tests and making it so that they use a standard Python file.
Diffstat (limited to 'tests/dbusmenu-gtk/dbusmenu.py.in')
| -rw-r--r-- | tests/dbusmenu-gtk/dbusmenu.py.in | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/tests/dbusmenu-gtk/dbusmenu.py.in b/tests/dbusmenu-gtk/dbusmenu.py.in deleted file mode 100644 index ce159e1..0000000 --- a/tests/dbusmenu-gtk/dbusmenu.py.in +++ /dev/null @@ -1,71 +0,0 @@ -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") - - - - |
