Merge lp:~diegosarmentero/ubuntuone-control-panel/limit-bandwidth into lp:ubuntuone-control-panel
| Status: | Merged |
|---|---|
| Approved by: | dobey on 2012-03-28 |
| Approved revision: | 304 |
| Merged at revision: | 301 |
| Proposed branch: | lp:~diegosarmentero/ubuntuone-control-panel/limit-bandwidth |
| Merge into: | lp:ubuntuone-control-panel |
| Diff against target: |
83 lines (+42/-2) 3 files modified
ubuntuone/controlpanel/backend.py (+7/-2) ubuntuone/controlpanel/gui/qt/tests/test_preferences.py (+15/-0) ubuntuone/controlpanel/tests/test_backend.py (+20/-0) |
| To merge this branch: | bzr merge lp:~diegosarmentero/ubuntuone-control-panel/limit-bandwidth |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| dobey (community) | Approve on 2012-03-28 | ||
| Natalia Bidart | 2012-03-27 | Approve on 2012-03-28 | |
|
Review via email:
|
|||
Commit Message
- Adding limit_bandwidth attribute to the info dict processed by preferences (LP: #944256).
- 302. By Diego Sarmentero on 2012-03-28
-
Improves in limit detection.
- 303. By Diego Sarmentero on 2012-03-28
-
Adding test for backend
| Natalia Bidart (nataliabidart) wrote : | # |
I really like the code!
One tiny note: the test added should have something like this:
@inlineCall
def test_file_
"""The settings_info method exercises its callback."""
# ...
}
so we fully test that even if SD limits are not -1, the limits returned to the UI are -1 when throttling is disabled.
| Diego Sarmentero (diegosarmentero) wrote : | # |
> I really like the code!
>
> One tiny note: the test added should have something like this:
>
> @inlineCallbacks
> def test_file_
> """The settings_info method exercises its callback."""
> self.patch(
> self.be.
>
> # ...
>
> backend.
> backend.UPLOAD_KEY: -1,
> }
>
> so we fully test that even if SD limits are not -1, the limits returned to the
> UI are -1 when throttling is disabled.
Fixed
- 304. By Diego Sarmentero on 2012-03-28
-
Improving test.


Thanks for working on this!
We should not add a new entry LIMIT_BW_KEY in the dictionary since that will require a FFe (since the API changes), and also because is not necessary.
The bug is clearly where you detected it (the missing call to limits_enabled = yield self.sd_ client. bandwidth_ throttling_ enabled( )), so we should indeed add that call, and then make both result[ DOWNLOAD_ KEY] = limits['download'] and result[UPLOAD_KEY] be -1, since the agreement between the UI and the backend is:
- if limits are -1, then it means that throttling is disabled.
- if any limit is not -1, then throttling is enabled for that limit.
Does the above make sense?