From a3e47ef85e04fe54a226fa83bf1d3ba124cd78fb Mon Sep 17 00:00:00 2001 From: Jorrit Schaap <schaap@astron.nl> Date: Thu, 11 Feb 2016 19:12:20 +0000 Subject: [PATCH] Task #8887: one can't mock the 'protected' __call__ method. so renamed it to execute and let __call__ be a wrapper for execte --- LCS/Messaging/python/messaging/RPC.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/LCS/Messaging/python/messaging/RPC.py b/LCS/Messaging/python/messaging/RPC.py index e6aaa05bcc1..ce439d29e06 100644 --- a/LCS/Messaging/python/messaging/RPC.py +++ b/LCS/Messaging/python/messaging/RPC.py @@ -23,6 +23,9 @@ from .messagebus import ToBus, FromBus from .messages import RequestMessage, ReplyMessage import uuid +import logging + +logger = logging.getLogger(__name__) def _analyze_args(args,kwargs): HasKwArgs=(len(kwargs)>0) @@ -134,6 +137,10 @@ class RPC(): result=myrpc(request) """ + return self.execute(*args, **kwargs) + + def execute(self, *args, **kwargs): + '''execute the remote procedure call''' timeout = kwargs.pop("timeout", self.timeout) Content = _args_as_content(*args, **kwargs) HasArgs, HasKwArgs = _analyze_args(args, kwargs) -- GitLab