diff --git a/tests/manual_tests/__init__.py b/tests/manual_tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/manual_tests/list_comments_by_author_last_update_test.py b/tests/manual_tests/list_comments_by_author_last_update_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d7c950f92f1488b3cf4ad5c91165a30f765371b0 --- /dev/null +++ b/tests/manual_tests/list_comments_by_author_last_update_test.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +from .test_base import run_test + +if __name__ == '__main__': + reference_hive_node_url = 'https://api.hive.blog' + test_hive_node_url = 'http://127.0.0.1:8080' + + payload = { + "jsonrpc":"2.0", + "method":"database_api.list_comments", + "params" : { + "start" : ['steemit', '1970-01-01T00:00:00', '', ''], + "limit" : 10, + "order" : 'by_author_last_update' + }, + "id":1 + } + + run_test(reference_hive_node_url, test_hive_node_url, payload, ['author', 'permlink', 'updated_at']) diff --git a/tests/manual_tests/list_comments_by_cashout_test.py b/tests/manual_tests/list_comments_by_cashout_test.py new file mode 100644 index 0000000000000000000000000000000000000000..69847e06e03cbdc5f137bbd22d38437477186dd3 --- /dev/null +++ b/tests/manual_tests/list_comments_by_cashout_test.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 +from .test_base import run_test + +if __name__ == '__main__': + reference_hive_node_url = 'https://api.hive.blog' + test_hive_node_url = 'http://127.0.0.1:8080' + + payload = { + "jsonrpc":"2.0", + "method":"database_api.list_comments", + "params" : { + "start" : ['1970-01-01T00:00:00', '', ''], + "limit" : 10, + "order" : 'by_cashout_time' + }, + "id":1 + } + + run_test(reference_hive_node_url, test_hive_node_url, payload, ['author', 'permlink', 'parent_author', 'parent_permlink', 'created']) diff --git a/tests/manual_tests/list_comments_by_parent_test.py b/tests/manual_tests/list_comments_by_parent_test.py new file mode 100644 index 0000000000000000000000000000000000000000..00a0ce719728e4df0cee8c6150ff6a4f87696325 --- /dev/null +++ b/tests/manual_tests/list_comments_by_parent_test.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 +from .test_base import run_test + +if __name__ == '__main__': + reference_hive_node_url = 'https://api.hive.blog' + test_hive_node_url = 'http://127.0.0.1:8080' + + payload = { + "jsonrpc":"2.0", + "method":"database_api.list_comments", + "params" : { + "start" : ['steemit', 'firstpost', '', ''], + "limit" : 10, + "order" : 'by_parent' + }, + "id":1 + } + + run_test(reference_hive_node_url, test_hive_node_url, payload, ['author', 'permlink', 'parent_author', 'parent_permlink', 'created']) diff --git a/tests/manual_tests/list_comments_by_permlink.py b/tests/manual_tests/list_comments_by_permlink.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ef3e3339c49b317af35cb243bf3c149d07c3d8 --- /dev/null +++ b/tests/manual_tests/list_comments_by_permlink.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 +from .test_base import run_test + +if __name__ == '__main__': + reference_hive_node_url = 'https://api.hive.blog' + test_hive_node_url = 'http://127.0.0.1:8080' + + payload = { + "jsonrpc" : "2.0", + "method" : "database_api.list_comments", + "params" : { + "start" : ['', ''], + "limit" : 10, + "order" : 'by_permlink' + }, + "id" : 1 + } + + run_test(reference_hive_node_url, test_hive_node_url, payload, ['author', 'permlink']) diff --git a/tests/manual_tests/list_comments_by_root_test.py b/tests/manual_tests/list_comments_by_root_test.py new file mode 100644 index 0000000000000000000000000000000000000000..5b9a6a0926141ecbd3d81d7f317953037bc4f1e4 --- /dev/null +++ b/tests/manual_tests/list_comments_by_root_test.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 +from .test_base import run_test + +if __name__ == '__main__': + reference_hive_node_url = 'https://api.hive.blog' + test_hive_node_url = 'http://127.0.0.1:8080' + + payload = { + "jsonrpc" : "2.0", + "method" : "database_api.list_comments", + "params" : { + "start" : ['steemit', 'firstpost', '', ''], + "limit" : 20, + "order" : 'by_root' + }, + "id":1 + } + + run_test(reference_hive_node_url, test_hive_node_url, payload, ['author', 'permlink', 'root_author', 'root_permlink', 'created']) + diff --git a/tests/manual_tests/list_comments_by_update_test.py b/tests/manual_tests/list_comments_by_update_test.py new file mode 100644 index 0000000000000000000000000000000000000000..5c5bcd2742be431cbfd17f78599de43923a866da --- /dev/null +++ b/tests/manual_tests/list_comments_by_update_test.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 +from .test_base import run_test + +if __name__ == '__main__': + reference_hive_node_url = 'https://api.hive.blog' + test_hive_node_url = 'http://127.0.0.1:8080' + + payload = { + "jsonrpc":"2.0", + "method":"database_api.list_comments", + "params" : { + "start" : ['steemit', '1970-01-01T00:00:00', '', ''], + "limit" : 10, + "order" : 'by_update' + }, + "id":1 + } + + run_test(reference_hive_node_url, test_hive_node_url, payload, ['author', 'permlink', 'parent_author', 'parent_permlink', 'updated_at']) diff --git a/tests/manual_tests/test_base.py b/tests/manual_tests/test_base.py new file mode 100644 index 0000000000000000000000000000000000000000..0e35eb29f1319d0850fc9160ebec8b326a5bb615 --- /dev/null +++ b/tests/manual_tests/test_base.py @@ -0,0 +1,24 @@ +def run_test(reference_node_url, test_node_url, payload, table_keys): + import prettytable + from requests import post + from json import dumps + + print("Querying reference node") + resp = post(reference_node_url, dumps(payload)) + + json = resp.json() + table = prettytable.PrettyTable() + table.field_names = table_keys + for row in json['result']['comments']: + table.add_row([row[key] for key in table_keys]) + print(table) + + print("Querying test node") + resp = post(test_node_url, dumps(payload)) + + json = resp.json() + table = prettytable.PrettyTable() + table.field_names = table_keys + for row in json['result']: + table.add_row([row[key] for key in table_keys]) + print(table)