diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-25 20:29:26 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-01-05 11:30:20 +0100 |
commit | 5865d41f889d326b51fb0b68be9a41c46d6cad83 (patch) | |
tree | d884341b8a08f690ab2dc72cc8f72f22929e37a1 /qa | |
parent | 406f35d99d0fcd2f50370280e605283d04da466a (diff) |
authproxy: Add support for RPC named arguments
Diffstat (limited to 'qa')
-rw-r--r-- | qa/rpc-tests/test_framework/authproxy.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/qa/rpc-tests/test_framework/authproxy.py b/qa/rpc-tests/test_framework/authproxy.py index 9bee1962e2..09ed611299 100644 --- a/qa/rpc-tests/test_framework/authproxy.py +++ b/qa/rpc-tests/test_framework/authproxy.py @@ -138,14 +138,16 @@ class AuthServiceProxy(object): self.__conn.request(method, path, postdata, headers) return self._get_response() - def __call__(self, *args): + def __call__(self, *args, **argsn): AuthServiceProxy.__id_count += 1 log.debug("-%s-> %s %s"%(AuthServiceProxy.__id_count, self._service_name, json.dumps(args, default=EncodeDecimal, ensure_ascii=self.ensure_ascii))) + if args and argsn: + raise ValueError('Cannot handle both named and positional arguments') postdata = json.dumps({'version': '1.1', 'method': self._service_name, - 'params': args, + 'params': args or argsn, 'id': AuthServiceProxy.__id_count}, default=EncodeDecimal, ensure_ascii=self.ensure_ascii) response = self._request('POST', self.__url.path, postdata.encode('utf-8')) if response['error'] is not None: |