Merge lp:~ralsina/ubuntuone-client/fix_904300 into lp:ubuntuone-client
| Status: | Merged |
|---|---|
| Approved by: | Natalia Bidart on 2012-01-03 |
| Approved revision: | 1176 |
| Merged at revision: | 1175 |
| Proposed branch: | lp:~ralsina/ubuntuone-client/fix_904300 |
| Merge into: | lp:ubuntuone-client |
| Diff against target: |
52 lines (+17/-3) 2 files modified
tests/platform/windows/test_os_helper.py (+13/-1) ubuntuone/platform/windows/os_helper.py (+4/-2) |
| To merge this branch: | bzr merge lp:~ralsina/ubuntuone-client/fix_904300 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Natalia Bidart | Approve on 2012-01-03 | ||
| Diego Sarmentero (community) | 2011-12-29 | Approve on 2012-01-02 | |
|
Review via email:
|
|||
Commit Message
Implement is_root for windows.
Description of the Change
Implement is_root for windows.
| Natalia Bidart (nataliabidart) wrote : | # |
Can you please add a test for this, patching the shell.IsUserAnA
| Roberto Alsina (ralsina) wrote : | # |
> Can you please add a test for this, patching the shell.IsUserAnA
Sure, added!
- 1174. By Roberto Alsina on 2012-01-02
-
test
- 1175. By Roberto Alsina on 2012-01-02
-
merged trunk
| Natalia Bidart (nataliabidart) wrote : | # |
Thanks a lot for adding the test, though you should note that if you remove the "return" under the is_root implementation, the test will keep passing.
You can simplify and improve the test by doing something like:
def test_isanadmin_
"""Test that shell.IsUserAnAdmin is called."""
expected = object()
self.
actual = os_helper.is_root()
self.
(and remove the set_called def).
What do you think?
| Roberto Alsina (ralsina) wrote : | # |
> Thanks a lot for adding the test, though you should note that if you remove
> the "return" under the is_root implementation, the test will keep passing.
>
> You can simplify and improve the test by doing something like:
>
> def test_isanadmin_
> """Test that shell.IsUserAnAdmin is called."""
> expected = object()
> self.patch(
> actual = os_helper.is_root()
> self.assertEqua
>
> (and remove the set_called def).
>
> What do you think?
Much better, thanks! Pushed in revno 1176
- 1176. By Roberto Alsina on 2012-01-03
-
improved test as suggested by nessita


+1