uitests: Add module_trace.py coverage

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-08-22 16:22:41 -04:00
parent 28f57cbf2f
commit 7bfe8139c0
2 changed files with 12 additions and 2 deletions

View File

@ -97,12 +97,22 @@ class VMMCLI(uiutils.UITestCase):
self.app.topwin.find("test default", "table cell") self.app.topwin.find("test default", "table cell")
def testShowCLIError(self): def testShowCLIError(self):
# Unknown option
self.app.open(extra_opts=["--idontexist"]) self.app.open(extra_opts=["--idontexist"])
self._click_alert_button("Unhandled command line", "Close") self._click_alert_button("Unhandled command line", "Close")
uiutils.check_in_loop(lambda: not self.app.is_running()) uiutils.check_in_loop(lambda: not self.app.is_running())
def testShowConnectBadURI(self): # Missing VM
self.app.open(extra_opts=["--show-domain-delete", "IDONTEXIST"])
self._click_alert_button("does not have VM", "Close")
uiutils.check_in_loop(lambda: not self.app.is_running())
# Bad URI
baduri = "fribfrobfroo" baduri = "fribfrobfroo"
self.app = uiutils.VMMDogtailApp(baduri) self.app = uiutils.VMMDogtailApp(baduri)
self._click_alert_button(baduri, "Close") self._click_alert_button(baduri, "Close")
uiutils.check_in_loop(lambda: not self.app.is_running()) uiutils.check_in_loop(lambda: not self.app.is_running())
def testCLITraceLibvirt(self):
self.app.open(extra_opts=["--trace-libvirt=mainloop"])
self.sleep(5)

View File

@ -80,7 +80,7 @@ def wrap_module(module, mainloop, regex):
CHECK_MAINLOOP = mainloop CHECK_MAINLOOP = mainloop
for name in dir(module): for name in dir(module):
if regex and not re.match(regex, name): if regex and not re.match(regex, name):
continue continue # pragma: no cover
obj = getattr(module, name) obj = getattr(module, name)
if isinstance(obj, FunctionType): if isinstance(obj, FunctionType):
wrap_func(module, obj) wrap_func(module, obj)