Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • hive/tests_api
1 result
Show changes
Commits on Source (79)
Showing
with 122 additions and 84 deletions
......@@ -9,7 +9,6 @@
- get_account_references
- get_account_reputations
- get_account_votes
- get_accounts
- get_active_votes
- get_active_witnesses
- get_block
......@@ -233,16 +232,6 @@ Windows call:
Results:
`"ApiError: get_account_votes is no longer supported, for details see https://steemit.com/steemit/@steemitdev/additional-public-api-change"
#### get_accounts
Linux call:
`python3 get_accounts.py https://api.steem.house https://api.steemit.com ./ steemit alice steempeak
Windows call:
`python get_accounts.py https://api.steemit.com https://api.steem.house ./ steemit alice steempeak
Results:
Works fine.
#### get_active_votes
Linux call:
`python3 get_active_votes.py https://api.steem.house https://api.steemit.com ./ drakos open-letter-to-justin-sun-and-the-steem-community
......
#!/usr/bin/python3
import os
import sys
sys.path.append(os.path.dirname(__file__) + "/../../../")
import json
from testbase import SimpleJsonTest
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("test_node", type = str, help = "IP address of test node")
parser.add_argument("ref_node", type = str, help = "IP address of reference node")
parser.add_argument("work_dir", type = str, help = "Work dir")
parser.add_argument("account", type = str, nargs='+', help = "Account name")
args = parser.parse_args()
tester = SimpleJsonTest(args.test_node, args.ref_node, args.work_dir)
print("Test node: {}".format(args.test_node))
print("Ref node: {}".format(args.ref_node))
print("Work dir: {}".format(args.work_dir))
print("account: {}".format(args.account))
test_args = {
"jsonrpc": "2.0",
"id": 1,
"method": "condenser_api.get_accounts",
"params": [
args.account
]
}
if tester.compare_results(test_args, True):
exit(0)
exit(1)
......@@ -21,10 +21,6 @@ tests = [
"method": "condenser_api.get_trending_tags",
"params": ["", 20]
},
{
"method": "condenser_api.get_accounts",
"params": [["initminer","temp"]]
},
{
"method": "condenser_api.get_active_votes",
"params": ["temp", "test1"]
......
......@@ -175,14 +175,6 @@
- args: '{"author":"steemit","permlink":"firstpost"}'
- <<: *base_test
# Method not found
# - test:
# - name: "get_accounts"
# - variable_binds:
# - method: "get_accounts"
# - args: '[["steemit"]]'
# - <<: *base_test
# No longer supported
# - test:
# - name: "get_account_votes"
......
......@@ -177,14 +177,6 @@
- args: '{"author":"steemit","permlink":"firstpost"}'
- <<: *base_test
# Method not found
# - test:
# - name: "get_accounts"
# - variable_binds:
# - method: "get_accounts"
# - args: '[["steemit"]]'
# - <<: *base_test
# No longer supported
# - test:
# - name: "get_account_votes"
......
......@@ -177,13 +177,6 @@
- args: '{"author":"steemit","permlink":"firstpost"}'
- <<: *base_benchmark
- benchmark:
- name: "get_accounts"
- variable_binds:
- method: "get_accounts"
- args: '[["steemit"]]'
- <<: *base_benchmark
# No longer supported
# - benchmark:
# - name: "get_account_votes"
......
......@@ -189,13 +189,6 @@
- args: '{"author":"steemit","permlink":"firstpost"}'
- <<: *base_test
- test:
- name: "get_accounts"
- variable_binds:
- method: "get_accounts"
- args: '[["steemit"]]'
- <<: *base_test
# No longer supported
# - test:
# - name: "get_account_votes"
......
---
test_name: Hivemind condenser_api.get_blog invalid account test
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_blog invalid account
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_blog"
params: {"account":"invalid_account","start_entry_id":0,"limit":1}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "invalid_account"
directory: "condenser_api_negative/get_blog"
error_response: true
\ No newline at end of file
---
test_name: Hivemind condenser_api.get_blog invalid limit combination patterns test
marks:
- patterntest # call returns post entries starting at start_entry_id going down towards 0 until limit, therefore limit <= start_entry_id + 1 (unless start_entry_id is 0 or -1)
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_blog invalid limit combination
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_blog"
params: {"account":"gtg","start_entry_id":11,"limit":20}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "invalid_limit_combo"
directory: "condenser_api_negative/get_blog"
error_response: true
\ No newline at end of file
---
test_name: Hivemind condenser_api.get_blog non existing account test
marks:
- patterntest
- negative
- failing
- xfail # wrong response, should be clean error (now there is no way to make difference between nonexisting account and account that does not blog)
includes:
- !include ../../common.yaml
stages:
- name: get_blog non existing account
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_blog"
params: {"account":"non.existing","start_entry_id":0,"limit":1}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "non_existing"
directory: "condenser_api_negative/get_blog"
error_response: true
\ No newline at end of file
---
test_name: Hivemind condenser_api.get_blog over limit test
marks:
- patterntest
- negative
includes:
- !include ../../common.yaml
stages:
- name: get_blog 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_blog"
params: {"account":"steemit","start_entry_id":0,"limit":501}
response:
status_code: 200
verify_response_with:
function: validate_response:compare_response_with_pattern
extra_kwargs:
method: "over_limit"
directory: "condenser_api_negative/get_blog"
error_response: true
\ No newline at end of file