aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-09-07 17:29:26 -0400
committerMarcoFalke <falke.marco@gmail.com>2017-11-03 10:07:59 -0400
commit305f7682420f03808deaaf249eadacd81a8748be (patch)
treefd3702899bce9e4fd40fc405e23e444282dddfd5
parent70268454e857dd89768c73fc4ce90976c3d1a7e6 (diff)
downloadbitcoin-305f7682420f03808deaaf249eadacd81a8748be.tar.xz
Limit AuthServiceProxyWrapper.__getattr__ wrapping
Change AuthServiceProxyWrapper.__getattr__ to only wrap proxied attributes, not real attributes. This way AuthServiceProxyWrapper can continue logging RPC calls without complicating other object usages, and special case handling for the .url property can be dropped. Github-Pull: #11277 Rebased-From: e02007aade3d449f030fe5c8b12beddd7df1b232
-rw-r--r--test/functional/test_framework/coverage.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/test/functional/test_framework/coverage.py b/test/functional/test_framework/coverage.py
index 227b1a17af..c0202e5609 100644
--- a/test/functional/test_framework/coverage.py
+++ b/test/functional/test_framework/coverage.py
@@ -31,10 +31,11 @@ class AuthServiceProxyWrapper(object):
self.auth_service_proxy_instance = auth_service_proxy_instance
self.coverage_logfile = coverage_logfile
- def __getattr__(self, *args, **kwargs):
- return_val = self.auth_service_proxy_instance.__getattr__(
- *args, **kwargs)
-
+ def __getattr__(self, name):
+ return_val = getattr(self.auth_service_proxy_instance, name)
+ if not isinstance(return_val, type(self.auth_service_proxy_instance)):
+ # If proxy getattr returned an unwrapped value, do the same here.
+ return return_val
return AuthServiceProxyWrapper(return_val, self.coverage_logfile)
def __call__(self, *args, **kwargs):
@@ -52,10 +53,6 @@ class AuthServiceProxyWrapper(object):
return return_val
- @property
- def url(self):
- return self.auth_service_proxy_instance.url
-
def __truediv__(self, relative_uri):
return AuthServiceProxyWrapper(self.auth_service_proxy_instance / relative_uri)