Skip to content
Snippets Groups Projects
Commit ec226bc6 authored by Michal Zander's avatar Michal Zander
Browse files

Adjust pattern test with new page-size and page parameters error handling

parent ed17b055
No related branches found
No related tags found
1 merge request!287Add max limit to endpoints
Showing
with 190 additions and 19 deletions
{
"code": "P0001",
"details": null,
"hint": null,
"message": "page-size <= 1000: page-size of 1001 is greater than maxmimum allowed"
}
\ No newline at end of file
---
test_name: Hafbe PostgREST
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: test
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/rpc/get_block_by_op"
method: POST
headers:
content-type: application/json
accept: application/json
json:
account-name: "blocktrades"
page-size: 1001
response:
status_code: 400
verify_response_with:
function: validate_response:compare_rest_response_with_pattern
extra_kwargs:
error_response: true
{
"code": "2201X",
"code": "P0001",
"details": null,
"hint": null,
"message": "OFFSET must not be negative"
"message": "page <= 0: page of -1 is lesser or equal 0"
}
\ No newline at end of file
......@@ -2,5 +2,5 @@
"code": "P0001",
"details": null,
"hint": null,
"message": "Page number exceeds total pages"
"message": "page-size <= 0: page-size of -1 is lesser or equal 0"
}
\ No newline at end of file
{
"code": "P0001",
"details": null,
"hint": null,
"message": "page-size <= 10000: page-size of 10001 is greater than maxmimum allowed"
}
\ No newline at end of file
---
test_name: Hafbe PostgREST
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: test
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/rpc/get_comment_operations"
method: POST
headers:
content-type: application/json
accept: application/json
json:
account-name: "blocktrades"
permlink: "blocktrades-witness-report-for-3rd-week-of-august"
page-size: 10001
response:
status_code: 400
verify_response_with:
function: validate_response:compare_rest_response_with_pattern
extra_kwargs:
error_response: true
{
"code": "2201X",
"code": "P0001",
"details": null,
"hint": null,
"message": "OFFSET must not be negative"
"message": "page <= 0: page of -1 is lesser or equal 0"
}
\ No newline at end of file
{
"code": "2201W",
"code": "P0001",
"details": null,
"hint": null,
"message": "LIMIT must not be negative"
"message": "page-size <= 0: page-size of -1 is lesser or equal 0"
}
\ No newline at end of file
{
"code": "P0001",
"details": null,
"hint": null,
"message": "page-size <= 100: page-size of 101 is greater than maxmimum allowed"
}
\ No newline at end of file
---
test_name: Hafbe PostgREST
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: test
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/rpc/get_comment_permlinks"
method: POST
headers:
content-type: application/json
accept: application/json
json:
account-name: "blocktrades"
page-size: 101
response:
status_code: 400
verify_response_with:
function: validate_response:compare_rest_response_with_pattern
extra_kwargs:
error_response: true
{
"code": "2201X",
"code": "P0001",
"details": null,
"hint": null,
"message": "OFFSET must not be negative"
"message": "page <= 0: page of -1 is lesser or equal 0"
}
\ No newline at end of file
{
"code": "2201W",
"code": "P0001",
"details": null,
"hint": null,
"message": "LIMIT must not be negative"
"message": "page-size <= 0: page-size of -1 is lesser or equal 0"
}
\ No newline at end of file
{
"code": "P0001",
"details": null,
"hint": null,
"message": "result-limit <= 1000: result-limit of 1001 is greater than maxmimum allowed"
}
\ No newline at end of file
---
test_name: Hafbe PostgREST
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: test
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/rpc/get_latest_blocks"
method: POST
headers:
content-type: application/json
accept: application/json
json:
result-limit: 1001
response:
status_code: 400
verify_response_with:
function: validate_response:compare_rest_response_with_pattern
extra_kwargs:
error_response: true
{
"code": "2201W",
"code": "P0001",
"details": null,
"hint": null,
"message": "LIMIT must not be negative"
"message": "result-limit <= 0: result-limit of -1 is lesser or equal 0"
}
\ No newline at end of file
{
"code": "P0001",
"details": null,
"hint": null,
"message": "page-size <= 10000: page-size of 10001 is greater than maxmimum allowed"
}
\ No newline at end of file
---
test_name: Hafbe PostgREST
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: test
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/rpc/get_witness_voters"
method: POST
headers:
content-type: application/json
accept: application/json
json:
account-name: "blocktrades"
page-size: 10001
response:
status_code: 400
verify_response_with:
function: validate_response:compare_rest_response_with_pattern
extra_kwargs:
error_response: true
{
"code": "2201X",
"code": "P0001",
"details": null,
"hint": null,
"message": "OFFSET must not be negative"
}
"message": "page <= 0: page of -1 is lesser or equal 0"
}
\ No newline at end of file
{
"code": "2201W",
"code": "P0001",
"details": null,
"hint": null,
"message": "LIMIT must not be negative"
}
"message": "page-size <= 0: page-size of -1 is lesser or equal 0"
}
\ No newline at end of file
{
"code": "P0001",
"details": null,
"hint": null,
"message": "result-limit <= 10000: result-limit of 10001 is greater than maxmimum allowed"
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment