Skip to content
Snippets Groups Projects
Commit 5a250138 authored by Andrzej Lisak's avatar Andrzej Lisak
Browse files

[ABW]: added .fatnode pattern for existing get_content negative test

added new negative tests for get_content and get_content_replies to cover cases of nonexisting, deleted post and deleted many times
added positive test for post deleted many times but recreated
parent d848985f
No related branches found
No related tags found
1 merge request!141Tests for changes in get_content negative response
Showing
with 331 additions and 3 deletions
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"abs_rshares": 0,
"active": "1970-01-01T00:00:00",
"active_votes": [],
"allow_curation_rewards": false,
"allow_replies": false,
"allow_votes": false,
"author": "",
"author_reputation": 0,
"author_rewards": 0,
"beneficiaries": [],
"body": "",
"body_length": 0,
"cashout_time": "1970-01-01T00:00:00",
"category": "",
"children": 0,
"children_abs_rshares": 0,
"created": "1970-01-01T00:00:00",
"curator_payout_value": "0.000 HBD",
"depth": 0,
"id": 0,
"json_metadata": "",
"last_payout": "1970-01-01T00:00:00",
"last_update": "1970-01-01T00:00:00",
"max_accepted_payout": "0.000 HBD",
"max_cashout_time": "1970-01-01T00:00:00",
"net_rshares": 0,
"net_votes": 0,
"parent_author": "",
"parent_permlink": "",
"pending_payout_value": "0.000 HBD",
"percent_steem_dollars": 0,
"permlink": "",
"promoted": "0.000 HBD",
"reblogged_by": [],
"replies": [],
"reward_weight": 0,
"root_author": "",
"root_permlink": "",
"root_title": "",
"title": "",
"total_payout_value": "0.000 HBD",
"total_pending_payout_value": "0.000 HBD",
"total_vote_weight": 0,
"url": "",
"vote_rshares": 0
}
}
{ {
"code": -32602, "code": -32199,
"data": "post was not found in cache", "data": "Post jsc/testing-summary was deleted 1 time(s)",
"message": "Invalid parameters" "message": "Invalid parameters"
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
test_name: Hivemind condenser_api.get_content deleted post patterns test test_name: Hivemind condenser_api.get_content deleted post patterns test
marks: marks:
- patterntest - patterntest # bug in old HM and empty post in fat node
- negative - negative
includes: includes:
......
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"abs_rshares": 0,
"active": "1970-01-01T00:00:00",
"active_votes": [],
"allow_curation_rewards": false,
"allow_replies": false,
"allow_votes": false,
"author": "",
"author_reputation": 0,
"author_rewards": 0,
"beneficiaries": [],
"body": "",
"body_length": 0,
"cashout_time": "1970-01-01T00:00:00",
"category": "",
"children": 0,
"children_abs_rshares": 0,
"created": "1970-01-01T00:00:00",
"curator_payout_value": "0.000 HBD",
"depth": 0,
"id": 0,
"json_metadata": "",
"last_payout": "1970-01-01T00:00:00",
"last_update": "1970-01-01T00:00:00",
"max_accepted_payout": "0.000 HBD",
"max_cashout_time": "1970-01-01T00:00:00",
"net_rshares": 0,
"net_votes": 0,
"parent_author": "",
"parent_permlink": "",
"pending_payout_value": "0.000 HBD",
"percent_steem_dollars": 0,
"permlink": "",
"promoted": "0.000 HBD",
"reblogged_by": [],
"replies": [],
"reward_weight": 0,
"root_author": "",
"root_permlink": "",
"root_title": "",
"title": "",
"total_payout_value": "0.000 HBD",
"total_pending_payout_value": "0.000 HBD",
"total_vote_weight": 0,
"url": "",
"vote_rshares": 0
}
}
{
"code": -32000,
"data": "IndexError: list index out of range",
"message": "Server error"
}
{
"code": -32199,
"data": "Post ilmam/test was deleted 5 time(s)",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_content deleted post patterns test
marks:
- patterntest # bug in old HM and empty post in fat node; post deleted 5 times within 5mln blocks and not recreated at the end
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_content gtg
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "condenser_api.get_content"
params: ["ilmam", "test"]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "multi_deleted_post"
directory: "condenser_api_negative/get_content"
error_response: true
\ No newline at end of file
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"abs_rshares": 0,
"active": "1970-01-01T00:00:00",
"active_votes": [],
"allow_curation_rewards": false,
"allow_replies": false,
"allow_votes": false,
"author": "",
"author_reputation": 0,
"author_rewards": 0,
"beneficiaries": [],
"body": "",
"body_length": 0,
"cashout_time": "1970-01-01T00:00:00",
"category": "",
"children": 0,
"children_abs_rshares": 0,
"created": "1970-01-01T00:00:00",
"curator_payout_value": "0.000 HBD",
"depth": 0,
"id": 0,
"json_metadata": "",
"last_payout": "1970-01-01T00:00:00",
"last_update": "1970-01-01T00:00:00",
"max_accepted_payout": "0.000 HBD",
"max_cashout_time": "1970-01-01T00:00:00",
"net_rshares": 0,
"net_votes": 0,
"parent_author": "",
"parent_permlink": "",
"pending_payout_value": "0.000 HBD",
"percent_steem_dollars": 0,
"permlink": "",
"promoted": "0.000 HBD",
"reblogged_by": [],
"replies": [],
"reward_weight": 0,
"root_author": "",
"root_permlink": "",
"root_title": "",
"title": "",
"total_payout_value": "0.000 HBD",
"total_pending_payout_value": "0.000 HBD",
"total_vote_weight": 0,
"url": "",
"vote_rshares": 0
}
}
{
"code": -32000,
"data": "IndexError: list index out of range",
"message": "Server error"
}
{
"code": -32602,
"data": "Post jsc/nonexisting-post does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_content nonexisting post patterns test
marks:
- patterntest # bug in old HM and empty post in fat node
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_content
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "condenser_api.get_content"
params: ["jsc", "nonexisting-post"]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "nonexisting_post"
directory: "condenser_api_negative/get_content"
error_response: true
\ No newline at end of file
{
"id": 1,
"jsonrpc": "2.0",
"result": []
}
{
"id": 1,
"jsonrpc": "2.0",
"result": []
}
{
"code": -32199,
"data": "Post jsc/testing-summary was deleted 1 time(s)",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_content_replies deleted post patterns test
marks:
- patterntest # empty result in old HM and fat node
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_content_replies
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "condenser_api.get_content_replies"
params: ["jsc", "testing-summary"]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "deleted_post"
directory: "condenser_api_negative/get_content_replies"
error_response: true
\ No newline at end of file
{
"id": 1,
"jsonrpc": "2.0",
"result": []
}
{
"id": 1,
"jsonrpc": "2.0",
"result": []
}
{
"code": -32199,
"data": "Post ilmam/test was deleted 5 time(s)",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_content_replies deleted post patterns test
marks:
- patterntest # empty result in old HM and fat node; post deleted 5 times within 5mln blocks and not recreated at the end
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_content_replies
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "condenser_api.get_content_replies"
params: ["ilmam", "test"]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "multi_deleted_post"
directory: "condenser_api_negative/get_content_replies"
error_response: true
\ No newline at end of file
{
"id": 1,
"jsonrpc": "2.0",
"result": []
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment