diff options
author | brunoerg <brunoely.gc@gmail.com> | 2022-06-16 19:13:37 -0300 |
---|---|---|
committer | brunoerg <brunoely.gc@gmail.com> | 2022-08-16 19:21:51 -0300 |
commit | 3e44bee08eb93e086179b92007649d47652aa439 (patch) | |
tree | 496c5aa3422ad4acf82edd19d03f84ad6c6769a9 /test/functional/interface_rest.py | |
parent | 91497031cbd74a0665b7fc31eb6b73bfb7bd0d40 (diff) |
test: add coverage for `/rest/deploymentinfo`
Diffstat (limited to 'test/functional/interface_rest.py')
-rwxr-xr-x | test/functional/interface_rest.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py index f36bbda3af..eec1c8fffb 100755 --- a/test/functional/interface_rest.py +++ b/test/functional/interface_rest.py @@ -383,6 +383,17 @@ class RESTTest (BitcoinTestFramework): assert_equal(self.test_rest_request(f"/headers/{bb_hash}", query_params={"count": 1}), self.test_rest_request(f"/headers/1/{bb_hash}")) assert_equal(self.test_rest_request(f"/blockfilterheaders/basic/{bb_hash}", query_params={"count": 1}), self.test_rest_request(f"/blockfilterheaders/basic/5/{bb_hash}")) + self.log.info("Test the /deploymentinfo URI") + + deployment_info = self.nodes[0].getdeploymentinfo() + assert_equal(deployment_info, self.test_rest_request('/deploymentinfo')) + + non_existing_blockhash = '42759cde25462784395a337460bde75f58e73d3f08bd31fdc3507cbac856a2c4' + resp = self.test_rest_request(f'/deploymentinfo/{non_existing_blockhash}', ret_type=RetType.OBJ, status=400) + assert_equal(resp.read().decode('utf-8').rstrip(), "Block not found") + + resp = self.test_rest_request(f"/deploymentinfo/{INVALID_PARAM}", ret_type=RetType.OBJ, status=400) + assert_equal(resp.read().decode('utf-8').rstrip(), f"Invalid hash: {INVALID_PARAM}") if __name__ == '__main__': RESTTest().main() |