diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-04-26 06:02:39 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-04-26 06:02:39 +0200 |
| commit | 029375928139997036346f01489ccae60d12dfb3 (patch) | |
| tree | d460e96610b977d197b10b15f0e563d2cc581f83 /tests | |
| parent | 9d8c5e68a0fcb9655a559c54408a5873259c5778 (diff) | |
autopilot, use kill instead of pkill to close applications
(bzr r2342.2.4)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/autopilot/autopilot/tests/__init__.py | 4 | ||||
| -rw-r--r-- | tests/autopilot/autopilot/tests/test_launcher.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/autopilot/autopilot/tests/__init__.py b/tests/autopilot/autopilot/tests/__init__.py index d23eb5e33..e8ed05af0 100644 --- a/tests/autopilot/autopilot/tests/__init__.py +++ b/tests/autopilot/autopilot/tests/__init__.py @@ -270,14 +270,14 @@ class AutopilotTestCase(VideoCapturedTestCase, KeybindingsHelper): app = self.KNOWN_APPS[app_name] self.bamf.launch_application(app['desktop-file'], files) apps = self.bamf.get_running_applications_by_desktop_file(app['desktop-file']) - self.addCleanup(call, ["pkill", "-f", app['process-name']]) + self.addCleanup(call, "kill `pidof %s`" % (app['process-name']), shell=True) self.assertThat(len(apps), Equals(1)) return apps[0] def close_all_app(self, app_name): """Close all instances of the app_name.""" app = self.KNOWN_APPS[app_name] - self.addCleanup(call, ["pkill", "-f", app['process-name']]) + self.addCleanup(call, "kill `pidof %s`" % (app['process-name']), shell=True) super(LoggedTestCase, self).tearDown() def get_app_instances(self, app_name): diff --git a/tests/autopilot/autopilot/tests/test_launcher.py b/tests/autopilot/autopilot/tests/test_launcher.py index a10f9acc1..e2f625af3 100644 --- a/tests/autopilot/autopilot/tests/test_launcher.py +++ b/tests/autopilot/autopilot/tests/test_launcher.py @@ -575,8 +575,10 @@ class LauncherVisualTests(LauncherTestCase): """Killing bamfdaemon should not duplicate any launcher icon.""" self.start_app("Calculator") self.start_app("System Settings") + # We launch also xterm without using self.start_app since it's an application + # without .desktop file. os.spawnlp(os.P_NOWAIT, "xterm", "xterm", "-title", "Autopilot XTerm", "-e", "sh") - self.addCleanup(call, ["killall", "xterm"]) + self.addCleanup(call, ["pkill", "xterm"]) # FIXME bamf emulator should wait until a window is open sleep(1) |
