Merge lp://qastaging/~diegosarmentero/ubuntuone-control-panel/transfers into lp://qastaging/ubuntuone-control-panel

Proposed by Diego Sarmentero
Status: Merged
Approved by: Diego Sarmentero
Approved revision: 350
Merged at revision: 344
Proposed branch: lp://qastaging/~diegosarmentero/ubuntuone-control-panel/transfers
Merge into: lp://qastaging/ubuntuone-control-panel
Diff against target: 531 lines (+371/-3)
4 files modified
ubuntuone/controlpanel/gui/__init__.py (+5/-0)
ubuntuone/controlpanel/gui/qt/systray.py (+121/-1)
ubuntuone/controlpanel/gui/qt/tests/__init__.py (+12/-1)
ubuntuone/controlpanel/gui/qt/tests/test_systray.py (+233/-1)
To merge this branch: bzr merge lp://qastaging/~diegosarmentero/ubuntuone-control-panel/transfers
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+119932@code.qastaging.launchpad.net

Commit message

- Show current and recent transfers on the transfers menu (LP: #1034542).

Description of the change

You will need this branch:
lp:~diegosarmentero/ubuntuone-client/menu-progress

to test it IRL on windows.

To post a comment you must log in.
347. By Diego Sarmentero

fixing tests

348. By Diego Sarmentero

fixed import

349. By Diego Sarmentero

improves in progress actoin

Revision history for this message
Roberto Alsina (ralsina) wrote :

Looks great!

review: Approve
Revision history for this message
Manuel de la Peña (mandel) wrote :

Maybe an assert for the following is better than just a simple comment:

127 + # This is never executed on Ubuntu

and

134 + # This is never executed on Ubuntu

If not an assert a log call.

Also, why do we do the following:

340 + self.patch(systray.TransfersMenu, "startTimer", lambda s, x: None)
341 + yield super(TransfersMenuTestCase, self).setUp()

Do we have to patch it before calling the super version? Can we add a comment with the reason.

The definition of a call like:

384 + def fake_sync_menu():
385 + """Fake backend sync_menu."""
386 + # Return copy of in_progress
387 + return {RECENTTRANSFERS: [], UPLOADING: in_progress[:]}

is done several times. We can do that in the setUp, for example like this:

self.recent_transfers = []
self.uploading = []

def fake_sync_menu():
    return return {RECENTTRANSFERS: self.recent_transfers, UPLOADING: self.uploading}

and just change the value of the vars according to the tests.

review: Needs Fixing
350. By Diego Sarmentero

Some improves in logs and tests

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

> Maybe an assert for the following is better than just a simple comment:
>
> 127 + # This is never executed on Ubuntu
>
> and
>
> 134 + # This is never executed on Ubuntu
>
> If not an assert a log call.
>
> Also, why do we do the following:
>
> 340 + self.patch(systray.TransfersMenu, "startTimer", lambda s, x: None)
> 341 + yield super(TransfersMenuTestCase, self).setUp()
>
> Do we have to patch it before calling the super version? Can we add a comment
> with the reason.
>
> The definition of a call like:
>
> 384 + def fake_sync_menu():
> 385 + """Fake backend sync_menu."""
> 386 + # Return copy of in_progress
> 387 + return {RECENTTRANSFERS: [], UPLOADING: in_progress[:]}
>
> is done several times. We can do that in the setUp, for example like this:
>
> self.recent_transfers = []
> self.uploading = []
>
> def fake_sync_menu():
> return return {RECENTTRANSFERS: self.recent_transfers, UPLOADING:
> self.uploading}
>
> and just change the value of the vars according to the tests.

Done!

Revision history for this message
Manuel de la Peña (mandel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches