Changeset View
Changeset View
Standalone View
Standalone View
test/functional/interface_rest.py
Show All 40 Lines | |||||
class RESTTest (BitcoinTestFramework): | class RESTTest (BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 2 | self.num_nodes = 2 | ||||
self.extra_args = [["-rest"], []] | self.extra_args = [["-rest"], []] | ||||
def skip_test_if_missing_module(self): | |||||
self.skip_if_no_wallet() | |||||
def test_rest_request(self, uri, http_method='GET', req_type=ReqType.JSON, body='', status=200, ret_type=RetType.JSON): | def test_rest_request(self, uri, http_method='GET', req_type=ReqType.JSON, body='', status=200, ret_type=RetType.JSON): | ||||
rest_uri = '/rest' + uri | rest_uri = '/rest' + uri | ||||
if req_type == ReqType.JSON: | if req_type == ReqType.JSON: | ||||
rest_uri += '.json' | rest_uri += '.json' | ||||
elif req_type == ReqType.BIN: | elif req_type == ReqType.BIN: | ||||
rest_uri += '.bin' | rest_uri += '.bin' | ||||
elif req_type == ReqType.HEX: | elif req_type == ReqType.HEX: | ||||
rest_uri += '.hex' | rest_uri += '.hex' | ||||
▲ Show 20 Lines • Show All 277 Lines • Show Last 20 Lines |