Unity code looks good to me.
The test needs some tuning:
111 + desktop_file = self.KNOWN_APPS['Calculator']['desktop-file'] 112 + if self.launcher.model.get_icon_by_desktop_id(desktop_file) != None: 113 + self.skip("Calculator icon is already on the launcher.") 114 + 115 + self.start_app('Calculator') 116 + icon = self.launcher.model.get_icon_by_desktop_id(desktop_file) 117 + self.assertThat(icon.shortcut, GreaterThan(0))
Instead of skipping the test when the calculator is already opened, just close it and you can just do:
self.close_all_app('Calculator') calc = self.start_app('Calculator') icon = self.launcher.model.get_icon_by_desktop_id(calc.desktop_file) self.assertThat(icon.shortcut, Eventually(GreaterThan(0)))
(using eventually to avoid false-negatives)
« Back to merge proposal
Unity code looks good to me.
The test needs some tuning:
111 + desktop_file = self.KNOWN_ APPS['Calculato r']['desktop- file'] model.get_ icon_by_ desktop_ id(desktop_ file) != None: "Calculator icon is already on the launcher.") app('Calculator ') model.get_ icon_by_ desktop_ id(desktop_ file) (icon.shortcut, GreaterThan(0))
112 + if self.launcher.
113 + self.skip(
114 +
115 + self.start_
116 + icon = self.launcher.
117 + self.assertThat
Instead of skipping the test when the calculator is already opened, just close it and you can just do:
self.close_ all_app( 'Calculator' ) app('Calculator ') model.get_ icon_by_ desktop_ id(calc. desktop_ file) (icon.shortcut, Eventually( GreaterThan( 0)))
calc = self.start_
icon = self.launcher.
self.assertThat
(using eventually to avoid false-negatives)