> 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)
If the Calculator is pinned, closing it will not remove the icon from the launcher.
> Unity code looks good to me. APPS['Calculato r']['desktop- file'] model.get_ icon_by_ desktop_ id(desktop_ file) "Calculator icon is already on the launcher.") app('Calculator ') model.get_ icon_by_ desktop_ id(desktop_ file) (icon.shortcut, GreaterThan(0)) all_app( 'Calculator' ) app('Calculator ') model.get_ icon_by_ desktop_ id(calc. desktop_ file) (icon.shortcut, Eventually( GreaterThan( 0)))
>
> The test needs some tuning:
>
> 111 + desktop_file = self.KNOWN_
> 112 + if self.launcher.
> != None:
> 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_
> calc = self.start_
> icon = self.launcher.
> self.assertThat
>
> (using eventually to avoid false-negatives)
If the Calculator is pinned, closing it will not remove the icon from the launcher.