on xenial help sign in
Use subprocess.check_call when caling url-dispatcher, so an error will be raised if it fails.
c5cc48eLeo Arias
tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py+3−1
@@ -20,6 +20,7 @@
20"""Test the integration with the URL dispatcher service."""
20"""Test the integration with the URL dispatcher service."""
21
21
22import os
22import os
23+import subprocess
23
24
24from autopilot import platform
25from autopilot import platform
25from autopilot.matchers import Eventually
26from autopilot.matchers import Eventually
@@ -70,7 +71,8 @@ MainView {
70
71
71 self.assertEqual('', self.main_window.get_current_focused_app_id())
72 self.assertEqual('', self.main_window.get_current_focused_app_id())
72 self.addCleanup(os.system, 'pkill qmlscene')
73 self.addCleanup(os.system, 'pkill qmlscene')
74+ subprocess.check_call(
73− os.system('url-dispatcher application:///{}'.format(desktop_file_name))
75+ ['url-dispatcher', 'application:///{}'.format(desktop_file_name)])
74 self.assertThat(
76 self.assertThat(
75 self.main_window.get_current_focused_app_id,
77 self.main_window.get_current_focused_app_id,
76 Eventually(Equals(application_name)))
78 Eventually(Equals(application_name)))