Commit 4ee51004 authored by Andrzej Lisak's avatar Andrzej Lisak

[ABW]: many database_api negative tests fixed patterns and marked as passing

above tests also separated into single test .yaml files
similar thing done in other APIs just to have folders and examples ready
parent c34332cf
{
"code": -32602,
"data": "post '@gtg/not_existing_permlink' does not exist",
"data": "Post gtg/not_existing_permlink does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_post_header not existing permlink patterns test
# not documented on https://developers.hive.io/apidefinitions/#apidefinitions-bridge
marks:
- patterntest # original gives no error, just no result
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_post_header 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: "bridge.get_post_header"
params: {"author":"gtg", "permlink":"not_existing_permlink"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "post_not_found"
directory: "bridge_api_negative/get_post_header"
error_response: true
---
test_name: Hivemind bridge_api.get_post_header patterns test
# not documented on https://developers.hive.io/apidefinitions/#apidefinitions-bridge
marks:
- patterntest
includes:
- !include ../../common.yaml
stages:
- name: get_post_header
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
headers:
content-type: application/json
json:
jsonrpc: "2.0"
id: 1
method: "bridge.get_post_header"
params: {"author":"steemit", "permlink":"firstpost"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "steemit"
directory: "bridge_api_patterns/get_post_header"
{
"code": -32602,
"data": "account 'not.existing' does not exist",
"data": "Account 'not.existing' does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_followers over limit test
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_followers over limit
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_followers"
params: ["steemit",null,"blog",1001]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "over_limit"
directory: "condenser_api_negative/get_followers"
error_response: true
---
test_name: Hivemind condenser_api.get_followers patterns test
marks:
- patterntest
includes:
- !include ../../common.yaml
stages:
- name: get_followers
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_followers"
params: ["steemit",null,"blog",10]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "blog"
directory: "condenser_api_patterns/get_followers"
{
"code": -32602,
"data": "Post givemeyoursteem/ does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_author_last_update" correct date and author
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments_by_author_last_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-28T17:15:12", "givemeyoursteem", ""],
"limit": 10,
"order": "by_author_last_update",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_author_last_update_no_permlink"
directory: "database_api_negative/list_comments"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "Post givemeyoursteem/winners-of-steemit-food-challenge-3 does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_author_last_update" correct date and author wrong permlink
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments_by_author_last_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-28T17:15:12", "givemeyoursteem", "winners-of-steemit-food-challenge-3"],
"limit": 10,
"order": "by_author_last_update",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_author_last_update_post_not_found"
directory: "database_api_negative/list_comments"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "Date should be in format Y-m-d H:M:S or Y-m-dTH:M:S",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_cashout_time" wrong date size
marks:
- patterntest
- negative
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": ["2016-07-08", "", ""],
"limit": 10,
"order": "by_cashout_time",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_cashout_time_wrong_date"
directory: "database_api_negative/list_comments"
error_response: true
{
"code": -32602,
"data": "Date should be in format Y-m-d H:M:S or Y-m-dTH:M:S",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_last_update" wrong date
marks:
- patterntest
- negative
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-24", "", ""],
"limit": 10,
"order": "by_last_update",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_last_update_wrong_date"
directory: "database_api_negative/list_comments"
error_response: true
{
"code": -32602,
"data": "Post givemeyoursteem/ does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_parent" child_author
marks:
- patterntest # child_author, child_permlink are optional (but only when both are skipped)
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments_by_parent
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": ["knozaki2015", "re-givemeyoursteem-winners-of-steemit-food-challenge-3-desserts-to-die-for-20160828t181032961z", "givemeyoursteem", ""],
"limit": 10,
"order": "by_parent",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_parent_child_no_permlink"
directory: "database_api_negative/list_comments"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "Post vi1son/ does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_root" with child_author only
marks:
- patterntest # child_author, child_permlink are optional (but only when both are skipped)
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments_by_root
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": ["givemeyoursteem", "winners-of-steemit-food-challenge-3-desserts-to-die-for", "vi1son", ""],
"limit": 10,
"order": "by_root",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_root_child_no_permlink"
directory: "database_api_negative/list_comments"
error_response: true
{
"code": -32602,
"data": "Post vi1son/randomvalues does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_root" wrong child_permlink
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments_by_root
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": ["givemeyoursteem", "winners-of-steemit-food-challenge-3-desserts-to-die-for", "vi1son", "randomvalues"],
"limit": 10,
"order": "by_root",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_root_child_not_found"
directory: "database_api_negative/list_comments"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "Post vi1son/ does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_root" only root_author
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments_by_root
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": ["vi1son", "", "", ""],
"limit": 10,
"order": "by_root",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "by_root_no_permlink"
directory: "database_api_negative/list_comments"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "Post giv/winner does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind database_api.list_comments patterns test order "by_root" wrong val
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: list_comments_by_root
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": ["giv", "winner", "", ""],
"limit": 10,
"order": "by_root",
}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs: