Code review comment for lp://staging/~tealeg/landscape-client/catch-unreachable-server

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

+1!

[2]

+ RegistrationProxy._setup_interface = fake_setup_interface
+ RegistrationProxy._register_handlers = fake_register_handlers
+ RegistrationProxy._remove_handlers = fake_remove_handlers

I believe you need to monkey patch the class instead of the instance because of the self._setup_interface(bus) call in RegistrationProxy.__init__() ?

This is unfortunate, I think RegistrationProxy should rather have a setup() method that you call explicitly to connect to DBus.

Also, the original method of the RegistrationProxy are not restored, so running these tests has (possibly nasty) side effects. I've noticed RegistrationProxyTest does something similar.

Just thought I'd mention it, we can live with this for now and surely it's something for another branch.

review: Approve

« Back to merge proposal