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

[ABW]: added tests for get_post_discussions_by_payout,...

[ABW]: added tests for get_post_discussions_by_payout, get_discussions_by_promoted and get_comment_discussions_by_payout
since those routines now reuse bridge_api SQL functions some functionality changed slightly (mostly more checks)
merge with some version of master (now old)
parents fbe4b2fd 0f9e40f5
No related branches found
No related tags found
1 merge request!148Readme files to condenser_api calls
Showing
with 17484 additions and 6 deletions
{
"code": -32602,
"data": "Category non_existing_tag does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_comment_discussions_by_payout no results test
marks:
- patterntest # original did not validate category (only gave empty result)
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_comment_discussions_by_payout no results
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_comment_discussions_by_payout"
params: {"tag":"non_existing_tag","limit":100}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "bad_category"
directory: "condenser_api_negative/get_comment_discussions_by_payout"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "filter_tags not supported",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "filter_tags not supported",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_discussions_by_promoted
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_discussions_by_promoted
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_discussions_by_promoted"
params: {"filter_tags": ["steemit","photography"]}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "nonempty_filter_tags"
directory: "condenser_api_negative/get_discussions_by_promoted"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "Category non_existing_tag does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_post_discussions_by_payout no results test
marks:
- patterntest # original did not validate category (only gave empty result)
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_post_discussions_by_payout no results
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_post_discussions_by_payout"
params: {"tag":"non_existing_tag","limit":20}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "bad_category"
directory: "condenser_api_negative/get_post_discussions_by_payout"
error_response: true
\ No newline at end of file
...@@ -15,7 +15,7 @@ params: ...@@ -15,7 +15,7 @@ params:
"limit": {number} "limit": {number}
optional, 1..500, default = {start_entry_id} + 1; part of paging mechanism optional, 1..500 (0 functions as skipped), default = {start_entry_id} + 1; part of paging mechanism
call selects up to limit blog posts starting at start_entry_id and going down by creation/reblog time call selects up to limit blog posts starting at start_entry_id and going down by creation/reblog time
ABW: as you can see it is not possible to select just the oldest post because adequate call of 0,1 produces ABW: as you can see it is not possible to select just the oldest post because adequate call of 0,1 produces
newest post due to special meaning of 0 as start_entry_id (it is a bug IMHO) newest post due to special meaning of 0 as start_entry_id (it is a bug IMHO)
......
...@@ -15,7 +15,7 @@ params: ...@@ -15,7 +15,7 @@ params:
"limit": {number} "limit": {number}
optional, 1..500, default = {start_entry_id} + 1; part of paging mechanism optional, 1..500 (0 functions as skipped), default = {start_entry_id} + 1; part of paging mechanism
call selects up to limit blog posts starting at start_entry_id and going down by creation/reblog time call selects up to limit blog posts starting at start_entry_id and going down by creation/reblog time
ABW: as you can see it is not possible to select just the oldest post because adequate call of 0,1 produces ABW: as you can see it is not possible to select just the oldest post because adequate call of 0,1 produces
newest post due to special meaning of 0 as start_entry_id (it is a bug IMHO) newest post due to special meaning of 0 as start_entry_id (it is a bug IMHO)
......
Lists not yet paid out replies ranked by pending payout, more paying first (order within the same payout is: newer first).
Slightly different post format but otherwise gives the same posts as bridge.get_ranked_posts with payout_comment sort.
method: "condenser_api.get_comment_discussion_by_payout"
params:
{
"start_author":"{author}", "start_permlink":"{permlink}"
start_author + start_permlink : optional, when given have to point to valid start post; paging mechanism (cuts out this and more paying replies)
"limit":"{limit}"
optional, 1..100, default = 20
"tag":"{tag}"
optional, actually means category, when given have to point to valid category; narrows down results to posts with given category
"truncate_body":{number}
optional, default = 0 (meaning no truncation); reduces maximal size of post body, cutting out all excess
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment