Code review comment for lp://qastaging/~diegosarmentero/ubuntuone-control-panel/transfers

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!

« Back to merge proposal