def test_stopService_calls_unregister_on_the_listener(self): listener = MagicMock() service = RegionControllerService(listener) service.stopService() self.assertThat( listener.unregister, MockCallsMatch(call("sys_dns", service.markDNSForUpdate), call("sys_proxy", service.markProxyForUpdate)))
def test_stopService_handles_canceling_processing(self): listener = MagicMock() service = RegionControllerService(listener) service.startProcessing() yield service.stopService() self.assertIsNone(service.processingDefer)