mirror of
https://github.com/FlipsideCrypto/livequery-models.git
synced 2026-02-06 10:56:46 +00:00
Add additional UDF tests for live API endpoints in live.yml
- Introduced multiple test cases for GET and POST methods, including batch JSON-RPC requests for Solana and Ethereum. - Ensured assertions validate response status codes and data structure integrity. - Enhanced coverage for API interactions to improve reliability and robustness of the deployment core.
This commit is contained in:
parent
2651a45b7e
commit
113e7b31d0
@ -24,4 +24,96 @@ models:
|
||||
'https://httpbin.org/post', 'foo'::VARIANT
|
||||
assertions:
|
||||
- result:data.json is not null
|
||||
- result:data.json = 'foo'
|
||||
- result:data.json = 'foo'
|
||||
- test_udf:
|
||||
name: test__live_udf_api_get_method
|
||||
args: |
|
||||
'https://httpbin.org/get'
|
||||
assertions:
|
||||
- result:status_code = 200
|
||||
- result:data.url = 'https://httpbin.org/get'
|
||||
- test_udf:
|
||||
name: test__live_udf_api_get_with_params
|
||||
args: |
|
||||
'GET', 'https://httpbin.org/get', {'Content-Type': 'application/json'}, {'param1': 'value1', 'param2': 'value2'}
|
||||
assertions:
|
||||
- result:status_code = 200
|
||||
- result:data.args is not null
|
||||
- result:data.args:param1 = 'value1'
|
||||
- result:data.args:param2 = 'value2'
|
||||
- test_udf:
|
||||
name: test__live_udf_api_post_batch_jsonrpc
|
||||
args: |
|
||||
'https://httpbin.org/post', {
|
||||
'jsonrpc': '2.0',
|
||||
'id': 1,
|
||||
'method': 'batch',
|
||||
'params': [
|
||||
{'id': 1, 'method': 'method1', 'params': {'param1': 'value1'}},
|
||||
{'id': 2, 'method': 'method2', 'params': {'param2': 'value2'}}
|
||||
]
|
||||
}
|
||||
assertions:
|
||||
- result:status_code = 200
|
||||
- result:data.json:jsonrpc = '2.0'
|
||||
- result:data.json:id = 1
|
||||
- result:data.json:method = 'batch'
|
||||
- result:data.json:params is not null
|
||||
- result:data.json:params[0]:id = 1
|
||||
- result:data.json:params[1]:id = 2
|
||||
- test_udf:
|
||||
name: test__live_udf_api_post_jsonrpc_solana
|
||||
args: |
|
||||
'POST',
|
||||
'https://api.mainnet-beta.solana.com',
|
||||
{'Content-Type': 'application/json'},
|
||||
{
|
||||
'jsonrpc': '2.0',
|
||||
'id': 1,
|
||||
'method': 'getVersion'
|
||||
},
|
||||
''
|
||||
assertions:
|
||||
- result:status_code = 200
|
||||
- result:data.jsonrpc = '2.0'
|
||||
- result:data.id = 1
|
||||
- result:data.result is not null
|
||||
- test_udf:
|
||||
name: test__live_udf_api_post_jsonrpc_solana_batch
|
||||
args: |
|
||||
'POST',
|
||||
'https://api.mainnet-beta.solana.com',
|
||||
{'Content-Type': 'application/json'},
|
||||
[
|
||||
{'jsonrpc': '2.0', 'id': 1, 'method': 'getVersion'},
|
||||
{'jsonrpc': '2.0', 'id': 2, 'method': 'getVersion'}
|
||||
],
|
||||
''
|
||||
assertions:
|
||||
- result:status_code = 200
|
||||
- result:data[0]:jsonrpc = '2.0'
|
||||
- result:data[0]:id = 1
|
||||
- result:data[0]:result is not null
|
||||
- result:data[1]:jsonrpc = '2.0'
|
||||
- result:data[1]:id = 2
|
||||
- result:data[1]:result is not null
|
||||
|
||||
- test_udf:
|
||||
name: test__live_udf_api_post_jsonrpc_ethereum_batch
|
||||
args: |
|
||||
'POST',
|
||||
'https://ethereum-rpc.publicnode.com',
|
||||
{'Content-Type': 'application/json'},
|
||||
[
|
||||
{'jsonrpc': '2.0', 'id': 1, 'method': 'eth_blockNumber', 'params': []},
|
||||
{'jsonrpc': '2.0', 'id': 2, 'method': 'eth_chainId', 'params': []}
|
||||
],
|
||||
''
|
||||
assertions:
|
||||
- result:status_code = 200
|
||||
- result:data[0]:jsonrpc = '2.0'
|
||||
- result:data[0]:id = 1
|
||||
- result:data[0]:result is not null
|
||||
- result:data[1]:jsonrpc = '2.0'
|
||||
- result:data[1]:id = 2
|
||||
- result:data[1]:result = '0x1'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user