(self, *args, **argsn)
| 124 | 'id': AuthServiceProxy.__id_count} |
| 125 | |
| 126 | def __call__(self, *args, **argsn): |
| 127 | postdata = self._json_dumps(self.get_request(*args, **argsn)) |
| 128 | response, status = self._request('POST', self.__url.path, postdata.encode('utf-8')) |
| 129 | # For backwards compatibility tests, accept JSON RPC 1.1 responses |
| 130 | if 'jsonrpc' not in response: |
| 131 | if response['error'] is not None: |
| 132 | raise JSONRPCException(response['error'], status) |
| 133 | elif 'result' not in response: |
| 134 | raise JSONRPCException({ |
| 135 | 'code': -343, 'message': 'missing JSON-RPC result'}, status) |
| 136 | elif status != HTTPStatus.OK: |
| 137 | raise JSONRPCException({ |
| 138 | 'code': -342, 'message': 'non-200 HTTP status code but no JSON-RPC error'}, status) |
| 139 | else: |
| 140 | return response['result'] |
| 141 | else: |
| 142 | assert_equal(response['jsonrpc'], '2.0') |
| 143 | if status != HTTPStatus.OK: |
| 144 | raise JSONRPCException({ |
| 145 | 'code': -342, 'message': 'non-200 HTTP status code'}, status) |
| 146 | if 'error' in response: |
| 147 | raise JSONRPCException(response['error'], status) |
| 148 | elif 'result' not in response: |
| 149 | raise JSONRPCException({ |
| 150 | 'code': -343, 'message': 'missing JSON-RPC 2.0 result and error'}, status) |
| 151 | return response['result'] |
| 152 | |
| 153 | def batch(self, rpc_call_list): |
| 154 | postdata = self._json_dumps(list(rpc_call_list)) |
nothing calls this directly
no test coverage detected