Commit 14f787d4 authored by Andrzej Lisak's avatar Andrzej Lisak

Merge branch 'pmaniora_separate_tests' into 'master'

bridge api separate tests

See merge request !69
parents c071251e 54eddd86
---
test_name: Hivemind bridge_api.get_community patterns test
# not documented on https://developers.hive.io/apidefinitions/#apidefinitions-bridge
marks:
- patterntest # communities do not exist in first 5mln, so only error response is possible
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_community
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_community"
params: {"name":"hive-123456", "observer":"steemit"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "community_not_found"
directory: "bridge_api_negative/get_community"
error_response: true
{
"code": -32602,
"data": "community not found",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "community not found",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_community_context patterns test # 8080
# not documented on https://developers.hive.io/apidefinitions/#apidefinitions-bridge
# no communities for 5mln set
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_community_context
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_community_context"
params: {"account": "steemit","name": "Hive Gaming"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "community_not_found"
directory: "bridge_api_negative/get_community_context"
error_response: true
---
test_name: Hivemind bridge_api.get_discussion non existing permlink patterns test
# not documented on https://developers.hive.io/apidefinitions/#apidefinitions-bridge
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_discussion
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_discussion"
params: {"author":"gtg", "permlink":"not_existing_permlink"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "not_existing_permlink"
directory: "bridge_api_negative/get_discussion"
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: ''",
"message": "Server error"
}
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: ''",
"message": "Server error"
}
---
test_name: Hivemind bridge_api.get_payout_stats invalid literal
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_payout_stats invalid literal
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_payout_stats"
params: [""]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "invalid_literal"
directory: "bridge_api_negative/get_payout_stats"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "limit must be positive",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit must be positive",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_payout_stats negative limit
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_payout_stats negative 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: "bridge.get_payout_stats"
params: [ -1 ]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "negative_limit"
directory: "bridge_api_negative/get_payout_stats"
error_response: true
---
test_name: Hivemind bridge_api.get_payout_stats over limit test
# not documented on https://developers.hive.io/apidefinitions/#apidefinitions-bridge
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_payout_stats 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: "bridge.get_payout_stats"
params: {"limit": 251}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "over_limit"
directory: "bridge_api_negative/get_payout_stats"
error_response: true
{
"code": -32602,
"data": "too many positional arguments",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "too many positional arguments",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_payout_stats too many positional arguments
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_payout_stats too many positional arguments
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_payout_stats"
params: ["10", ""]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "too_many_positional_arguments"
directory: "bridge_api_negative/get_payout_stats"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "'account' parameter lacking default value",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "missing a required argument: 'account'",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_profile account lacking vlaue
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_profile
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_profile"
params: {}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "empty"
directory: "bridge_api_negative/get_profile"
error_response: true
{
"code": -32602,
"data": "invalid account name type",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "invalid account name type",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_profile invalid account name type
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_profile invalid account name type
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_profile"
params: {"account":789}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "invalid_account_name_type"
directory: "bridge_api_negative/get_profile"
error_response: true
---
test_name: Hivemind bridge_api.get_profile not existing 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_profile
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_profile"
params: {"account":"not.existing"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "not_existing_account"
directory: "bridge_api_negative/get_profile"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "Account '468' does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_profile not existing 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_profile
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_profile"
params: {"account":"468"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "number_account"
directory: "bridge_api_negative/get_profile"
error_response: true
{
"code": -32602,
"data": "'account1' parameter lacking default value",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "missing a required argument: 'account1'",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_relationship_between_accounts account 1 lacking value # 8080
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_relationship_between_accounts account 1 lacking value
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_relationship_between_accounts"
params: {"account": "tinfoilfedora"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "account1_lacking_value"
directory: "bridge_api_negative/get_relationship_between_accounts"
error_response: true
{
"code": -32602,
"data": "'account2' parameter lacking default value",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "missing a required argument: 'account2'",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_relationship_between_accounts account 2 lacking value # 8080
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_relationship_between_accounts account 2 lacking value
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_relationship_between_accounts"
params: {"account1": "tinfoilfedora"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "account2_lacking_value"
directory: "bridge_api_negative/get_relationship_between_accounts"
error_response: true
{
"code": -32602,
"data": "invalid account (not specified)",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "invalid account (not specified)",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_relationship_between_accounts not specified account 2 # 8080
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages: