Hi,
Please try and replace the call() lines with this:
call("kill `pidof %s`" % (app['process-name']), shell=True)
Don't use pkill -f - it's dangerous. Once making these changes, please ensure that all the tests still pass.
130 + self.start_app("Calculator") 131 + self.start_app("System Settings") 132 + os.spawnlp(os.P_NOWAIT, "xterm", "xterm", "-title", "Autopilot XTerm", "-e", "sh") 133 + self.addCleanup(call, ["killall", "xterm"]) 134 + 135 + # FIXME bamf emulator should wait until a window is open 136 + sleep(1) 137 + [xterm_win] = [w for w in self.bamf.get_open_windows() if w.name == "Autopilot XTerm"] 138 + self.assertTrue(xterm_win.is_focused)
Please put all this in a method called "start_test_apps or something similar, then call it from your test.
154 + same_desktop = [i for i in bamf_icons if i.desktop_file == icon.desktop_file] 155 + self.assertThat(len(same_desktop), Equals(1))
Can you use 'get_icon_by_desktop_file' on the launcher model, to avoid this?
157 + same_appid = [i for i in bamf_icons if i.application_id == icon.application_id] 158 + self.assertThat(len(same_appid), Equals(1))
Similar thing here... we should probable add something to the launcher model like this:
def get_icon_by_filter(self, **kwargs): """Gets a launcher icon that matches the filter specified.
Returns None if there is no such launcher icon. """ icons = self.get_children_by_type(SimpleLauncherIcon, **kwargs) if len(icons): return icons[0]
return None
« Back to merge proposal
Hi,
Please try and replace the call() lines with this:
call("kill `pidof %s`" % (app['process- name']) , shell=True)
Don't use pkill -f - it's dangerous. Once making these changes, please ensure that all the tests still pass.
130 + self.start_ app("Calculator ") app("System Settings") os.P_NOWAIT, "xterm", "xterm", "-title", "Autopilot XTerm", "-e", "sh") (call, ["killall", "xterm"]) get_open_ windows( ) if w.name == "Autopilot XTerm"] (xterm_ win.is_ focused)
131 + self.start_
132 + os.spawnlp(
133 + self.addCleanup
134 +
135 + # FIXME bamf emulator should wait until a window is open
136 + sleep(1)
137 + [xterm_win] = [w for w in self.bamf.
138 + self.assertTrue
Please put all this in a method called "start_test_apps or something similar, then call it from your test.
154 + same_desktop = [i for i in bamf_icons if i.desktop_file == icon.desktop_file] (len(same_ desktop) , Equals(1))
155 + self.assertThat
Can you use 'get_icon_ by_desktop_ file' on the launcher model, to avoid this?
157 + same_appid = [i for i in bamf_icons if i.application_id == icon.applicatio n_id] (len(same_ appid), Equals(1))
158 + self.assertThat
Similar thing here... we should probable add something to the launcher model like this:
def get_icon_ by_filter( self, **kwargs):
"""Gets a launcher icon that matches the filter specified.
Returns None if there is no such launcher icon. children_ by_type( SimpleLauncherI con, **kwargs)
"""
icons = self.get_
if len(icons):
return icons[0]
return None