Merge lp:~gary-lasker/software-center/handle-trans-cancel-lp1027209 into lp:software-center
Status: | Merged |
---|---|
Merged at revision: | 3186 |
Proposed branch: | lp:~gary-lasker/software-center/handle-trans-cancel-lp1027209 |
Merge into: | lp:software-center |
Diff against target: |
183 lines (+94/-3) 3 files modified
softwarecenter/backend/installbackend_impl/aptd.py (+12/-0) softwarecenter/ui/gtk3/panes/availablepane.py (+12/-1) tests/gtk3/test_unity_launcher_integration.py (+70/-2) |
To merge this branch: | bzr merge lp:~gary-lasker/software-center/handle-trans-cancel-lp1027209 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Vogt | Needs Information | ||
Review via email: mp+124536@code.launchpad.net |
Commit message
* lp:~gary-lasker/software-center/handle-trans-cancel-lp1027209:
- don't add an application to the Unity launcher for the case
where an installation is cancelled (LP: #1027209)
Description of the change
This branch contains a proposed fix for bug 1027209. To test, follow the steps outlined in comment #9 in the bug, as shown below:
Follow the below steps to see the issue:
#. Open software-center
#. Click on install on a big application like wesnoth
#. Wait until the "In Progress" appears in the toplevel toolbar of s-c
#. Click on the "In Progress" button in the toolbar
#. Click on the "cancel" button of the install of the application
Result (current trunk USC): At the moment of the cancellation, the icon for the application is incorrectly added to the Unity launcher.
Expected (this branch): After a cancellation, no icon is added to the Unity launcher.
I've also included a new unit test for this bug to insure we don't regress on it.
Many thanks for your review!
On Fri, Sep 14, 2012 at 10:53:23PM -0000, Gary Lasker wrote:
> Gary Lasker has proposed merging lp:~gary-lasker/software-center/handle-trans-cancel-lp1027209 into lp:software-center.
[..]
> Follow the below steps to see the issue:
> #. Open software-center
> #. Click on install on a big application like wesnoth
> #. Wait until the "In Progress" appears in the toplevel toolbar of s-c
> #. Click on the "In Progress" button in the toolbar
> #. Click on the "cancel" button of the install of the application
>
> I've also included a new unit test for this bug to insure we don't regress on it.
Thanks for the branch and for adding a unittest (and the adding of
docstrings, always nice).
It looks fine, the only question I have is what happens if the
transaction errors, e.g. if the network gets lost during a download of
a application. Will that work as expected, i.e. not add anything to
the launcher or do we need to connect the transaction-stopped signal
for that?
[..] gtk3/test_ unity_launcher_ integration. py' test_unity_ launcher_ integration. py 2012-08-30 07:45:31 +0000 test_unity_ launcher_ integration. py 2012-09-14 22:52:21 +0000 pane.backend. emit("transacti on-finished" , with_sleep( ) install_ cancellation( self, app): pane.backend. emit("transacti on-started" , s.INSTALL) with_sleep( )
> === modified file 'tests/
> --- tests/gtk3/
> +++ tests/gtk3/
> @@ -60,6 +60,20 @@
> self.available_
> mock_result)
> do_events_
> +
> + def _simulate_
> + # pretend we started an install
> + self.available_
> + app.pkgname, app.appname,
> + "testid101",
> + TransactionType
> + do_events_
self. assertEqual(
self. available_ pane.unity_ launcher_ transaction_ queue.keys( ),
[" software- center" ])
> + # send the signal to cancel the install pane.backend. emit("transacti on-cancelled" , with_sleep( )
> + mock_result = Mock()
> + mock_result.pkgname = app.pkgname
> + self.available_
> + mock_result)
> + do_events_
[..]
I like the test in general, the above lines may make it even
better. To also check that the queue behaves in the right way
(i.e. stuff is added and taken out again).
Cheers,
Michael