Commit 54eddd86 authored by Andrzej Lisak's avatar Andrzej Lisak

[ABW]: added .orig files to new tests

accepted typical differences in patterns to new tests
removed duplicate tests that were moved to separate folders; moved some more bridge_api tests to their own folders
added some negative tests
parent cdb27ac0
......@@ -10,7 +10,7 @@
- !include ../../common.yaml
stages:
- name: get_community_context
- name: get_community
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
......
......@@ -10,7 +10,7 @@
- !include ../../common.yaml
stages:
- name: get_community_context
- name: get_discussion
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
......
{
"code": -32000,
"data": "ValueError: invalid literal for int() with base 10: ''",
"message": "Server error"
}
{
"code": -32602,
"data": "limit must be positive",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_payout_stats over limit
test_name: Hivemind bridge_api.get_payout_stats over limit test
# not documented on https://developers.hive.io/apidefinitions/#apidefinitions-bridge
marks:
- patterntest
- negative
......
{
"code": -32602,
"data": "limit exceeds max (251 > 250)",
"data": "too many positional arguments",
"message": "Invalid parameters"
}
......@@ -9,7 +9,7 @@
- !include ../../common.yaml
stages:
- name: get_post_header gtg
- name: get_profile
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
......
{
"code": -32602,
"data": "invalid account name type",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "account 'not.existing' does not exist",
"data": "Account 'not.existing' does not exist",
"message": "Invalid parameters"
}
......@@ -10,7 +10,7 @@
- !include ../../common.yaml
stages:
- name: get_post_header gtg
- name: get_profile
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
......
{
"code": -32602,
"data": "account '468' does not exist",
"data": "Account '468' does not exist",
"message": "Invalid parameters"
}
......@@ -10,7 +10,7 @@
- !include ../../common.yaml
stages:
- name: get_post_header gtg
- name: get_profile
request:
url: "{service.proto:s}://{service.server:s}:{service.port}/"
method: POST
......
{
"code": -32602,
"data": "'account1' parameter lacking default value",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "'account1' parameter lacking default value",
"data": "missing a required argument: 'account1'",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "'account2' parameter lacking default value",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "'account2' parameter lacking default value",
"data": "missing a required argument: 'account2'",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "invalid account (not specified)",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "invalid account (not specified)",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit must be positive",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.get_trending_topics patterns over limit test
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_trending_topics 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_trending_topics"
params: {"limit": 26}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "over_limit"
directory: "bridge_api_negative/get_trending_topics"
error_response: true
{
"code": -32602,
"data": "'account' parameter lacking default value",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "'account' parameter lacking default value",
"data": "missing a required argument: 'account'",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "account not found: `wyuh`",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "no account name specified",
"message": "Invalid parameters"
}
{
"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: 'steemit'",
"message": "Server error"
}
{
"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)",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "too many positional arguments",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "'community' parameter lacking default value",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "'community' parameter lacking default value",
"data": "missing a required argument: 'community'",
"message": "Invalid parameters"
}
{
"code": -32000,
"data": "UndefinedFunction: operator does not exist: character varying = integer\nLINE 1: SELECT id FROM hive_communities WHERE name = 789\n ^\nHINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.\n",
"message": "Server error"
}
......@@ -2,7 +2,7 @@
test_name: bridge_api.list_subscribers undefined operator # not documented
marks:
- patterntest
- patterntest # change it into proper error, server error, especially from SQL, is not good enough
- negative
includes:
......
{
"code": -32000,
"data": "InvalidTextRepresentation: invalid input syntax for integer: \"\"\nLINE 11: AND score >= ''\n ^\n",
"message": "Server error"
}
{
"code": -32000,
"data": "InvalidTextRepresentation: invalid input syntax for integer: \"\"\nLINE 11: AND score >= ''\n ^\n",
"data": "SyntaxError: syntax error at or near \"AND\"\nLINE 40: WHERE posts_and_scores.score >= AND NOT EXISTS(\n ^\n",
"message": "Server error"
}
......@@ -2,7 +2,7 @@
test_name: bridge_api.post_notifications invalid text representation
marks:
- patterntest
- patterntest # change it into proper error, server error, especially from SQL, is not good enough
- negative
includes:
......
{
"code": -32602,
"data": "'permlink' parameter lacking default value",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "'permlink' parameter lacking default value",
"data": "missing a required argument: 'permlink'",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "community not found",
"data": "post id not found",
"message": "Invalid parameters"
}
---
test_name: Hivemind bridge_api.account_notifications patterns test
marks:
- patterntest
- failing
- xfail # very different result
includes:
- !include ../../common.yaml
stages:
- name: account_notifications
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.account_notifications"
params: {"account":"steemit", "min_score": 15, "limit":20}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "steemit"
directory: "bridge_api_patterns/account_notifications"
---
test_name: Hivemind bridge_api.get_payout_stats patterns test
# not documented on https://developers.hive.io/apidefinitions/#apidefinitions-bridge
marks:
- patterntest
includes:
- !include ../../common.yaml
stages:
- name: get_payout_stats
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.0]
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "first"
directory: "bridge_api_patterns/get_payout_stats"
{
"blogs": 1862448.272,
"items": [
[
"@charlieshrem",
"@charlieshrem",
62129.025,
142,
null
],
[
"@ericvancewalton",
"@ericvancewalton",
58181.592,
678,
null
],
[
"@gavvet",
"@gavvet",
48153.825,
206,
null
],
[
"@dollarvigilante",
"@dollarvigilante",
36194.554,
141,
null
],
[
"@knozaki2015",
"@knozaki2015",
34414.827,
918,
null
],
[
"@sirwinchester",
"@sirwinchester",
31843.607,
992,
null
],
[
"@calaber24p",
"@calaber24p",
29554.962,
181,
null
],
[
"@sascha",
"@sascha",
27419.049,
187,
null
],
[
"@terrycraft",
"@terrycraft",
24246.728,
200,
null
],
[
"@dragonslayer109",
"@dragonslayer109",
23209.361,
374,
null
]
],
"total": 1862448.272
}
{
"blogs": 1862448.272,
"items": [
[
"@charlieshrem",
"@charlieshrem",
62129.025,
142,
null
],
[
"@ericvancewalton",
"@ericvancewalton",
58181.592,
678,
null
],
[
"@gavvet",
"@gavvet",
48153.825,
206,
null
],
[
"@dollarvigilante",
"@dollarvigilante",
36194.554,
141,
null
],
[
"@knozaki2015",
"@knozaki2015",
34414.827,
918,
null
],
[
"@sirwinchester",
"@sirwinchester",
31843.607,
992,
null
],
[
"@calaber24p",
"@calaber24p",
29554.962,
181,
null
],
[
"@sascha",
"@sascha",
27419.049,
187,
null
],
[
"@terrycraft",
"@terrycraft",
24246.728,
200,
null
],
[
"@dragonslayer109",
"@dragonslayer109",
23209.361,
374,
null
]
"blogs": 1866810.081,
"items": [
[
"@charlieshrem",
"@charlieshrem",
62150.551,
142,
null
],
"total": 1862448.272
}
\ No newline at end of file
[
"@ericvancewalton",
"@ericvancewalton",
58178.554,
678,
null
],
[
"@gavvet",
"@gavvet",
48152.134,
206,
null
],
[
"@dollarvigilante",
"@dollarvigilante",
36198.94,
141,
null
],
[
"@knozaki2015",
"@knozaki2015",
34424.306,
918,
null
],
[
"@sirwinchester",
"@sirwinchester",
31862.079,
992,
null
],
[
"@calaber24p",
"@calaber24p",
29553.355,
181,
null
],
[
"@sascha",
"@sascha",