Merge lp:~diegosarmentero/ubuntu-sso-client/remove-disconnect-signal into lp:ubuntu-sso-client
| Status: | Merged |
|---|---|
| Approved by: | Diego Sarmentero on 2012-01-27 |
| Approved revision: | 838 |
| Merged at revision: | 839 |
| Proposed branch: | lp:~diegosarmentero/ubuntu-sso-client/remove-disconnect-signal |
| Merge into: | lp:ubuntu-sso-client |
| Diff against target: |
180 lines (+104/-22) 2 files modified
ubuntu_sso/networkstate/linux.py (+0/-2) ubuntu_sso/networkstate/tests/test_linux.py (+104/-20) |
| To merge this branch: | bzr merge lp:~diegosarmentero/ubuntu-sso-client/remove-disconnect-signal |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Natalia Bidart | Approve on 2012-01-27 | ||
| Roberto Alsina (community) | 2012-01-23 | Approve on 2012-01-25 | |
|
Review via email:
|
|||
Commit Message
- Delete signal removal to keep listening to network state changes (LP: #920591).
Description of the Change
Maybe you will have in windows a trace where some tests related to test_webclient might be failing, this is happening also in trunk (and seems to be a timing issue):
| Natalia Bidart (nataliabidart) wrote : | # |
Branch looks mostly good, but I have some suggestions to improve the test readability. ATM, since the fake connect_to_siganl is returning self, it makes difficult to notice that dbus signals are also being faked by the same FakeDbusModule. Also, this is self.DBusException = self very complex to understand... why are you mocking an exception with a FakeDbusModule?
I advice not to mix fakes in this way, since future debugging may take longer and will be difficult to follow. Also, fakes and mocks should have an almost identical API with the object they are faking, so, for example, connect_to_signal should expect a siganl name and a callback, and it should return a different object than self, which has a certain API (has a remove method, for example). The fact that a test (that uses a fake with the correct API) pass, ensures more correctness in the production code.
So, below a proposal to improve the tests:
http://
- 838. By Diego Sarmentero on 2012-01-26
-
Improving Tests
| Diego Sarmentero (diegosarmentero) wrote : | # |
> Branch looks mostly good, but I have some suggestions to improve the test
> readability. ATM, since the fake connect_to_siganl is returning self, it makes
> difficult to notice that dbus signals are also being faked by the same
> FakeDbusModule. Also, this is self.DBusException = self very complex to
> understand... why are you mocking an exception with a FakeDbusModule?
>
> I advice not to mix fakes in this way, since future debugging may take longer
> and will be difficult to follow. Also, fakes and mocks should have an almost
> identical API with the object they are faking, so, for example,
> connect_to_signal should expect a siganl name and a callback, and it should
> return a different object than self, which has a certain API (has a remove
> method, for example). The fact that a test (that uses a fake with the correct
> API) pass, ensures more correctness in the production code.
>
> So, below a proposal to improve the tests:
> http://
Thanks for the suggestion, the tests has been improved.

+1