def testShowConnectBadURI(self): baduri = "fribfrobfroo" self.app = uiutils.VMMDogtailApp(baduri) alert = self.app.root.find("vmm dialog") alert.find_fuzzy(baduri) alert.find_fuzzy("Close", "push button").click() uiutils.check_in_loop(lambda: not self.app.is_running())
def _run_remote(opts): newapp = uiutils.VMMDogtailApp("test:///default") newapp.open(check_already_running=False, extra_opts=opts) uiutils.check(lambda: not newapp.is_running()) import dogtail.tree vapps = [ a for a in dogtail.tree.root.applications() if a.name == "virt-manager" ] uiutils.check(lambda: len(vapps) == 1) # Ensure connection showed up self.app.topwin.find("test default", "table cell")
def testShowRemoteConnect(self): """ Test the remote app dbus connection """ self.app.open() newapp = uiutils.VMMDogtailApp("test:///default") newapp.open() uiutils.check_in_loop(lambda: not newapp.is_running()) import dogtail.tree vapps = [ a for a in dogtail.tree.root.applications() if a.name == "virt-manager" ] self.assertEqual(len(vapps), 1) self.app.topwin.find("test default", "table cell")
def testShowCLIError(self): # Unknown option self.app.open(extra_opts=["--idontexist"]) self._click_alert_button("Unhandled command line", "Close") uiutils.check(lambda: not self.app.is_running()) # Missing VM self.app.open(extra_opts=["--show-domain-delete", "IDONTEXIST"]) self._click_alert_button("does not have VM", "Close") uiutils.check(lambda: not self.app.is_running()) # Bad URI baduri = "fribfrobfroo" self.app = uiutils.VMMDogtailApp(baduri) self._click_alert_button(baduri, "Close") uiutils.check(lambda: not self.app.is_running())