mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-06 19:23:41 +02:00
rest: add a test for unsuported /blockpart/ request type
This commit is contained in:
@@ -489,7 +489,11 @@ class RESTTest (BitcoinTestFramework):
|
||||
get_block_part(status=400, query_params={"offset": len(block_bin) + 1, "size": 1})
|
||||
get_block_part(status=400, query_params={"offset": 0, "size": len(block_bin) + 1})
|
||||
|
||||
self.test_rest_request(f"/blockpart/{blockhash}", status=400, req_type=ReqType.JSON, ret_type=RetType.OBJ)
|
||||
res = self.test_rest_request(f"/blockpart/{blockhash}", status=400, req_type=ReqType.BIN, ret_type=RetType.OBJ)
|
||||
assert res.read().decode().startswith("Block part offset missing or invalid")
|
||||
|
||||
res = self.test_rest_request(f"/blockpart/{blockhash}", query_params={"offset":0, "size":1}, status=400, req_type=ReqType.JSON, ret_type=RetType.OBJ)
|
||||
assert res.read().decode().startswith("JSON output is not supported for this request type")
|
||||
|
||||
self.log.info("Missing block data should cause REST API to fail")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user