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.
+1!
[2]
+ RegistrationPro xy._setup_ interface = fake_setup_ interface xy._register_ handlers = fake_register_ handlers xy._remove_ handlers = fake_remove_ handlers
+ RegistrationPro
+ RegistrationPro
I believe you need to monkey patch the class instead of the instance because of the self._setup_ interface( bus) call in RegistrationPro xy.__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 RegistrationPro xyTest does something similar.
Just thought I'd mention it, we can live with this for now and surely it's something for another branch.