Commit 3189c96a authored by Andrzej Lisak's avatar Andrzej Lisak

Merge branch 'limit_checks_change' into 'master'

pattern updates in relation to how limit (and other numerical params) checks work

See merge request !95
parents 14f787d4 376f1c4e
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: ''",
"data": "ValueError: invalid literal for int() with base 10: 'abc'",
"message": "Server error"
}
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: ''",
"message": "Server error"
"code": -32602,
"data": "invalid literal for int() with base 10: 'abc'",
"message": "Invalid parameters"
}
......@@ -19,7 +19,7 @@
jsonrpc: "2.0"
id: 1
method: "bridge.get_payout_stats"
params: [""]
params: ["abc"]
response:
status_code: 200
verify_response_with:
......
{
"code": -32602,
"data": "limit must be positive",
"data": "limit = -1 outside valid range [1:250]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (251 > 250)",
"data": "limit = 251 outside valid range [1:250]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit must be positive",
"data": "limit = -7 outside valid range [1:25]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (26 > 25)",
"data": "limit = 26 outside valid range [1:25]",
"message": "Invalid parameters"
}
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: ''",
"data": "ValueError: invalid literal for int() with base 10: 'abc'",
"message": "Server error"
}
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: ''",
"message": "Server error"
"code": -32602,
"data": "invalid literal for int() with base 10: 'abc'",
"message": "Invalid parameters"
}
......@@ -19,7 +19,7 @@
jsonrpc: "2.0"
id: 1
method: "bridge.list_pop_communities"
params: [""]
params: ["abc"]
response:
status_code: 200
verify_response_with:
......
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: 'steemit'",
"message": "Server error"
"code": -32602,
"data": "int() argument must be a string, a bytes-like object or a number, not 'list'",
"message": "Invalid parameters"
}
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: 'steemit'",
"message": "Server error"
"code": -32602,
"data": "int() argument must be a string, a bytes-like object or a number, not 'list'",
"message": "Invalid parameters"
}
......@@ -21,7 +21,7 @@
jsonrpc: "2.0"
id: 1
method: "bridge.list_pop_communities"
params: ["steemit"]
params: [["steemit"]]
response:
status_code: 200
verify_response_with:
......
{
"code": -32000,
"data": "InvalidRequestError: A value is required for bind parameter 'cutoff' (Background on this error at: http://sqlalche.me/e/13/cd3x)",
"message": "Server error"
}
{
"code": -32602,
"data": "limit exceeds max (77 > 25)",
"data": "limit = 77 outside valid range [1:25]",
"message": "Invalid parameters"
}
{
"code": -32000,
"data": "InvalidTextRepresentation: invalid input syntax for integer: \"\"\nLINE 11: AND score >= ''\n ^\n",
"data": "InvalidTextRepresentation: invalid input syntax for integer: \"abc\"\nLINE 11: AND score >= 'abc'\n ^\n",
"message": "Server error"
}
{
"code": -32000,
"data": "SyntaxError: syntax error at or near \"AND\"\nLINE 40: WHERE posts_and_scores.score >= AND NOT EXISTS(\n ^\n",
"message": "Server error"
"code": -32602,
"data": "invalid literal for int() with base 10: 'abc'",
"message": "Invalid parameters"
}
......@@ -2,7 +2,7 @@
test_name: bridge_api.post_notifications invalid text representation
marks:
- patterntest # change it into proper error, server error, especially from SQL, is not good enough
- patterntest
- negative
includes:
......@@ -19,7 +19,7 @@
jsonrpc: "2.0"
id: 1
method: "bridge.post_notifications"
params: ["steemit","firstpost", ""]
params: ["steemit","firstpost", "abc"]
response:
status_code: 200
verify_response_with:
......
{
"code": -32602,
"data": "post id not found",
"data": "Post steemit/ does not exist",
"message": "Invalid parameters"
}
......@@ -2,14 +2,14 @@
test_name: bridge_api.list_pop_communities invalid request error # 8080
marks:
- patterntest
- negative
- patterntest # original returns invalid request error here because the routine was apparently never used even once
# it is supposed to return communities that gained most new subscribers in last month (therefore only empty result is possible in 5mln blocks)
includes:
- !include ../../common.yaml
stages:
- name: bridge_api.list_pop_communities invalid request error
- name: bridge_api.list_pop_communities
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
......@@ -25,6 +25,5 @@
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "invalid_request_error"
directory: "bridge_api_negative/list_pop_communities"
error_response: true
method: "first"
directory: "bridge_api_patterns/list_pop_communities"
{
"code": -32602,
"data": "limit exceeds max (501 > 500)",
"data": "limit = 501 outside valid range [1:500]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (101 > 100)",
"data": "limit = 101 outside valid range [1:100]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (101 > 100)",
"data": "limit = 101 outside valid range [1:100]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (1001 > 1000)",
"data": "limit = 1001 outside valid range [1:1000]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (1001 > 1000)",
"data": "limit = 1001 outside valid range [1:1000]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (101 > 100)",
"data": "limit = 101 outside valid range [1:100]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (101 > 100)",
"data": "limit = 101 outside valid range [1:100]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (251 > 250)",
"data": "limit = 251 outside valid range [1:250]",
"message": "Invalid parameters"
}
......@@ -344,7 +344,7 @@
"vote_rshares": 5126864315829
},
{
"abs_rshares": "10027068167722",
"abs_rshares": 10001278717808,
"active": "2016-09-15T17:56:33",
"allow_curation_rewards": true,
"allow_replies": true,
......@@ -390,7 +390,7 @@
"precision": 3
},
"total_vote_weight": 13144057225008877639,
"vote_rshares": "9951683621819"
"vote_rshares": 10001278717808
},
{
"abs_rshares": 2354527407147,
......
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: ''",
"message": "Server error"
}
{
"code": -32602,
"data": "limit must be positive",
"data": "limit = 0 outside valid range [1:100]",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit exceeds max (101 > 100)",
"data": "limit = 101 outside valid range [1:100]",
"message": "Invalid parameters"
}
---
test_name: Hivemind tags_api.get_comment_discussions_by_payout patterns test no data error
test_name: Hivemind tags_api.get_comment_discussions_by_payout patterns test no data
marks:
- patterntest
- negative
- patterntest # original failed on empty string as limit, but now we treat it as default, so the results are the same as if params were skipped
includes:
- !include ../../common.yaml
......@@ -26,5 +25,4 @@
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "empty_params"
directory: "tags_api_negative/get_comment_discussions_by_payout"
error_response: true
\ No newline at end of file
directory: "tags_api_patterns/get_comment_discussions_by_payout"
......@@ -5,7 +5,7 @@ test_name: Hivemind database_api.list_comments patterns test order "by_cashout_t
marks:
- patterntest
- failing
- xfail # shows error when there is only one of optional value (first)
- xfail # should show error when there is only one of optional value (first)
includes:
- !include common.yaml
......@@ -35,7 +35,6 @@ stages:
method: "list_comments_not_found_by_account"
directory: "database_api_patterns"
error_response: true
ignore_tags: ["timestamp"]
---
test_name: Hivemind database_api.list_comments patterns test order "by_cashout_time" date and permlink
......@@ -43,7 +42,7 @@ test_name: Hivemind database_api.list_comments patterns test order "by_cashout_t
marks:
- patterntest
- failing
- xfail # shows error when there is only one of optional value (first)
- xfail # should show error when there is only one of optional value (second)
includes:
- !include common.yaml
......@@ -114,41 +113,6 @@ stages:
method: "list_comments_future_date"
directory: "database_api_patterns"
---
test_name: Hivemind database_api.list_comments patterns test order "by_cashout_time" no data
marks:
- patterntest
- failing
- xfail
includes:
- !include common.yaml
stages:
- name: list_comments_by_cashout_time
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.list_comments"
params:
{ "start": ["", "", ""], "limit": 10, "order": "by_cashout_time" }
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "list_comments_day_of_the_month_out_of_range"
directory: "database_api_patterns"
error_response: true
ignore_tags: ["timestamp"]
######################## PERMLINK ########################
---
test_name: Hivemind database_api.list_comments patterns test order "by_permlink" only author
......@@ -184,8 +148,6 @@ test_name: Hivemind database_api.list_comments patterns test order "by_permlink"
marks:
- patterntest
- failing
- xfail # abs_rshares/vote_rshares prior to first payout
includes:
- !include common.yaml
......@@ -564,77 +526,6 @@ stages:
######################## LAST UPDATE ########################
---
test_name: Hivemind database_api.list_comments patterns test order "by_last_update"
marks:
- patterntest
- failing
- xfail
includes:
- !include common.yaml
stages:
- name: list_comments_by_update
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.list_comments"
params:
{ "start": ["", "", "", ""], "limit": 10, "order": "by_last_update" }
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "list_comments_day_out_of_range_empty"
directory: "database_api_patterns"
error_response: true
ignore_tags: ["timestamp"]
---
test_name: Hivemind database_api.list_comments patterns test order "by_last_update" date in author
marks:
- patterntest # first arg is author, not date (error about date)
- failing
- xfail
includes:
- !include common.yaml
stages:
- name: list_comments_by_update
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.list_comments"
params:
{
"start": ["2016-08-24T21:29:42", "", "", ""],
"limit": 10,
"order": "by_last_update",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "list_comments_day_out_of_range_start_0"
directory: "database_api_patterns"
error_response: true
ignore_tags: ["timestamp"]
---
test_name: Hivemind database_api.list_comments patterns test order "by_last_update" good date
marks:
......@@ -740,41 +631,3 @@ stages:
method: "list_comments_by_last_update_future_date"
directory: "database_api_patterns"
---
test_name: Hivemind database_api.list_comments patterns test order "by_last_update" wrong day
marks:
- patterntest
- failing
- xfail
includes:
- !include common.yaml
stages:
- name: list_comments_by_update
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "database_api.list_comments"
params:
{
"start": ["", "2016-04-66T21:29:42", "", ""],
"limit": 10,
"order": "by_last_update"
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "list_comments_day_out_of_range_start_3"
directory: "database_api_patterns"
error_response: true
ignore_tags: ["timestamp"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment