on xenial help sign in
Use subprocess.check_call when caling url-dispatcher, so an error will be raised if it fails.
commit1ebf23dfb20c413571fcbb38f6b3cd70d8409a4b authorLeo Arias <leo.arias@canonical.com> dateFri 28 Mar 2014, 15:23 (13 years ago) parent183a834
1 file changed+3−1
tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py+3−1
tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py+3−1
@@ -20,6 +20,7 @@
2020"""Test the integration with the URL dispatcher service."""
2121
2222import os
23+import subprocess
2324
2425from autopilot import platform
2526from autopilot.matchers import Eventually
@@ -70,7 +71,8 @@ MainView {
7071
7172 self.assertEqual('', self.main_window.get_current_focused_app_id())
7273 self.addCleanup(os.system, 'pkill qmlscene')
73− os.system('url-dispatcher application:///{}'.format(desktop_file_name))
74+ subprocess.check_call(
75+ ['url-dispatcher', 'application:///{}'.format(desktop_file_name)])
7476 self.assertThat(
7577 self.main_window.get_current_focused_app_id,
7678 Eventually(Equals(application_name)))