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

[ABW]: added tests for get_trending_tags

parent ef358b5a
No related branches found
No related tags found
1 merge request!148Readme files to condenser_api calls
Showing
with 3494 additions and 10 deletions
{
"id": 1,
"jsonrpc": "2.0",
"result": []
}
{
"code": -32602,
"data": "Category nonexisting-category does not exist",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_trending_tags
marks:
- patterntest # original did not validate given page defining category
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_trending_tags
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_trending_tags"
params: {"start_tag":"nonexisting-category"}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "bad_tag"
directory: "condenser_api_negative/get_trending_tags"
error_response: true
\ No newline at end of file
{
"code": -32602,
"data": "limit must be positive",
"message": "Invalid parameters"
}
{
"code": -32602,
"data": "limit = 251 outside valid range [1:250]",
"message": "Invalid parameters"
}
---
test_name: Hivemind condenser_api.get_trending_tags under limit patterns test
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_trending_tags
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_trending_tags"
params: {"limit":0}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "under_limit"
directory: "condenser_api_negative/get_trending_tags"
error_response: true
\ No newline at end of file
Lists tags sort by all payout, with stats summary of comments and top_posts. Lists categories ordered by sum of pending payouts, with stats summary about comments and top posts.
method: "condenser_api.get_trending_tags" method: "condenser_api.get_trending_tags"
params: params:
{ {
"start_tag":"{tag}", "start_tag":"{tag}",
optional, point to tag; paging mechanism optional, when given has to point to valid tag; paging mechanism (cuts out this and more paying categories)
"limit":{number}, "limit":{number}
optional range 1...250; default = 250 optional, 1..250, default = 250
} }
\ No newline at end of file
[ [
{
"comments": 16,
"name": "dream",
"top_posts": 11,
"total_payouts": "31.138 HBD"
},
{ {
"comments": 14, "comments": 14,
"name": "governmentinsanity", "name": "governmentinsanity",
...@@ -1498,5 +1492,11 @@ ...@@ -1498,5 +1492,11 @@
"name": "spirit", "name": "spirit",
"top_posts": 4, "top_posts": 4,
"total_payouts": "7.461 HBD" "total_payouts": "7.461 HBD"
},
{
"comments": 1,
"name": "vpn",
"top_posts": 3,
"total_payouts": "7.308 HBD"
} }
] ]
This diff is collapsed.
This diff is collapsed.
---
test_name: Hivemind condenser_api.get_trending_tags limit 250 patterns test
marks:
- patterntest # not comparable to original due to ordering influenced by different pending payouts (also order of tags with the same payout was basically random)
includes:
- !include ../../common.yaml
stages:
- name: get_trending_tags limit 250
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_trending_tags"
params: {"limit":250}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "max_limit"
directory: "condenser_api_patterns/get_trending_tags"
\ No newline at end of file
[
{
"comments": 1,
"name": "elliotsmith",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "test-post-on-1473745309905",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "dansk",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "sun",
"top_posts": 3,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "esoteric",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "landalar",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "fiesta",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "sync",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 2,
"name": "taugul",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 1,
"name": "sandiegochargersvskansascitychiefsgameonline",
"top_posts": 1,
"total_payouts": "0.000 HBD"
}
]
[
{
"comments": 0,
"name": "acab",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "acapulco",
"top_posts": 2,
"total_payouts": "0.000 HBD"
},
{
"comments": 3,
"name": "acid",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "acmilan",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "acrylic",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "action",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "actual",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "actual-facts",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "acupuncture",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "adam",
"top_posts": 1,
"total_payouts": "0.000 HBD"
}
]
---
test_name: Hivemind condenser_api.get_trending_tags patterns test
marks:
- patterntest # previously paging didn't really worked when there was many categories with the same amount of payout (compare .orig here and in no_payout_2)
includes:
- !include ../../common.yaml
stages:
- name: get_trending_tags
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_trending_tags"
params: {"start_tag":"aboutmyself","limit":10}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "no_payout_1"
directory: "condenser_api_patterns/get_trending_tags"
\ No newline at end of file
[
{
"comments": 1,
"name": "elliotsmith",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "test-post-on-1473745309905",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "dansk",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "sun",
"top_posts": 3,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "esoteric",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "landalar",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "fiesta",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "sync",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 2,
"name": "taugul",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 1,
"name": "sandiegochargersvskansascitychiefsgameonline",
"top_posts": 1,
"total_payouts": "0.000 HBD"
}
]
[
{
"comments": 0,
"name": "adb",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 3,
"name": "add",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "administracion",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 1,
"name": "adobe",
"top_posts": 2,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "adrienis",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "adulthumor",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "aeroplane",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "aesthetic",
"top_posts": 1,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "african",
"top_posts": 4,
"total_payouts": "0.000 HBD"
},
{
"comments": 0,
"name": "after",
"top_posts": 1,
"total_payouts": "0.000 HBD"
}
]
---
test_name: Hivemind condenser_api.get_trending_tags patterns test
marks:
- patterntest # see no_payout_1
includes:
- !include ../../common.yaml
stages:
- name: get_trending_tags
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_trending_tags"
params: {"start_tag":"adam","limit":10}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "no_payout_2"
directory: "condenser_api_patterns/get_trending_tags"
\ No newline at end of file
[
{
"comments": 72,
"name": "wallpaper",
"top_posts": 27,
"total_payouts": "1663.943 HBD"
},
{
"comments": 102,
"name": "cocktails",
"top_posts": 7,
"total_payouts": "1569.236 HBD"
},
{
"comments": 34,
"name": "steemapp",
"top_posts": 3,
"total_payouts": "1546.429 HBD"
}
]
[
{
"comments": 102,
"name": "cocktails",
"top_posts": 7,
"total_payouts": "1569.381 HBD"
},
{
"comments": 34,
"name": "steemapp",
"top_posts": 3,
"total_payouts": "1546.452 HBD"
},
{
"comments": 36,
"name": "corporate-identity",
"top_posts": 2,
"total_payouts": "1541.611 HBD"
}
]
---
test_name: Hivemind condenser_api.get_trending_tags
marks:
- patterntest # original did not cut out record with given tag (see also no_payout_1)
includes:
- !include ../../common.yaml
stages:
- name: get_trending_tags
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_trending_tags"
params: {"start_tag":"wallpaper","limit":3}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "paginated"
directory: "condenser_api_patterns/get_trending_tags"
\ 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