From 5daa61b4087a125795ab01147986b1b74f69b376 Mon Sep 17 00:00:00 2001 From: Martin Lees <drov0@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:46:41 -0400 Subject: [PATCH] working base feature \o/ missing tests to change a community type --- hive/db/sql_scripts/hive_post_operations.sql | 11 +- .../mock_block_data_community.json | 180 ++++++++++++++++++ .../hive-211119_comments.pat.json | 153 +++++++++++++++ .../hive-211119_comments.tavern.yaml | 27 +++ .../hive-311119_comments.pat.json | 153 +++++++++++++++ .../hive-311119_comments.tavern.yaml | 27 +++ .../created/community_2111119.pat.json | 72 +++++++ .../created/community_2111119.tavern.yaml | 27 +++ .../created/community_3111119.pat.json | 72 +++++++ .../created/community_3111119.tavern.yaml | 27 +++ 10 files changed, 746 insertions(+), 3 deletions(-) create mode 100644 tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-211119_comments.pat.json create mode 100644 tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-211119_comments.tavern.yaml create mode 100644 tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-311119_comments.pat.json create mode 100644 tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-311119_comments.tavern.yaml create mode 100644 tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_2111119.pat.json create mode 100644 tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_2111119.tavern.yaml create mode 100644 tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_3111119.pat.json create mode 100644 tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_3111119.tavern.yaml diff --git a/hive/db/sql_scripts/hive_post_operations.sql b/hive/db/sql_scripts/hive_post_operations.sql index e0115ae8e..5edfdc91a 100644 --- a/hive/db/sql_scripts/hive_post_operations.sql +++ b/hive/db/sql_scripts/hive_post_operations.sql @@ -39,9 +39,12 @@ declare __community_type_topic CONSTANT SMALLINT := 1; __community_type_journal CONSTANT SMALLINT := 2; __community_type_council CONSTANT SMALLINT := 3; - __is_muted bool := FALSE; + __is_muted bool := TRUE; __community_id hivemind_app.hive_posts.community_id%TYPE; BEGIN + + RAISE NOTICE 'Function parameters: _block_num: %, _community_support_start_block: %, _parent_permlink: %, _author_id: %, is_comment: %', _block_num, _community_support_start_block, _parent_permlink, _author_id, is_comment; + IF _block_num < _community_support_start_block THEN __is_muted := FALSE; __community_id := NULL; @@ -71,6 +74,8 @@ BEGIN END IF; END IF; END IF; + ELSE + __is_muted := FALSE; END IF; END IF; @@ -173,8 +178,8 @@ ELSE FROM hivemind_app.prepare_tags( ARRAY_APPEND(_metadata_tags, _parent_permlink ) ) ) as tags_ids FROM hivemind_app.hive_accounts ha, - hivemind_app.process_community_post(_block_num, _community_support_start_block, _parent_permlink, author_id, FALSE) pcp, - hivemind_app.hive_permlink_data hpd + hivemind_app.process_community_post(_block_num, _community_support_start_block, _parent_permlink, ha.id, FALSE) pcp, + hivemind_app.hive_permlink_data hpd WHERE ha.name = _author and hpd.permlink = _permlink ON CONFLICT ON CONSTRAINT hive_posts_ux1 DO UPDATE SET diff --git a/mock_data/block_data/community_op/mock_block_data_community.json b/mock_data/block_data/community_op/mock_block_data_community.json index 3b0c6f49e..7999bb588 100644 --- a/mock_data/block_data/community_op/mock_block_data_community.json +++ b/mock_data/block_data/community_op/mock_block_data_community.json @@ -5112,6 +5112,186 @@ "body": "lorem ipsum", "json_metadata": "{}" } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "", + "parent_permlink": "hive-211119", + "author": "ismember", + "permlink": "ismember-hive-211119", + "title": "ismember This post will not be muted", + "body": "community type 2, ismember This post will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "", + "parent_permlink": "hive-211119", + "author": "notmember", + "permlink": "notmember-hive-211119", + "title": "notmember This post will BE muted", + "body": "community type 2, notmember This post will BE muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "ismember-hive-211119", + "author": "ismember", + "permlink": "re-ismember-hive-211119", + "title": "ismember This comment will not be muted", + "body": "community type 2, ismember This comment will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "re-ismember-hive-211119", + "author": "ismember", + "permlink": "re-re-ismember-hive-211119", + "title": "ismember, depth 2 comment, This comment will not be muted", + "body": "community type 2, ismember, depth 2 comment, This comment will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "ismember-hive-211119", + "author": "notmember", + "permlink": "re-2-ismember-hive-211119", + "title": "notmember This comment will not be muted", + "body": "community type 2, notmember This comment will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "", + "parent_permlink": "hive-211119", + "author": "ismember", + "permlink": "ismember-hive-211119", + "title": "community type 2, ismember This post will not be muted", + "body": "community type 2, ismember This post will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "", + "parent_permlink": "hive-211119", + "author": "notmember", + "permlink": "notmember-hive-211119", + "title": "notmember This post will BE muted", + "body": "community type 2, notmember This post will BE muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "ismember-hive-211119", + "author": "ismember", + "permlink": "re-ismember-hive-211119", + "title": "ismember This comment will not be muted", + "body": "community type 2, ismember This comment will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "re-ismember-hive-211119", + "author": "ismember", + "permlink": "re-re-ismember-hive-211119", + "title": "ismember, depth 2 comment, This comment will not be muted", + "body": "community type 2, ismember, depth 2 comment, This comment will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "ismember-hive-211119", + "author": "notmember", + "permlink": "re-2-ismember-hive-211119", + "title": "notmember This comment will not be muted", + "body": "community type 2, notmember This comment will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "", + "parent_permlink": "hive-311119", + "author": "ismember", + "permlink": "ismember-hive-311119", + "title": "ismember This post will not be muted", + "body": "community type 3, ismember This post will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "", + "parent_permlink": "hive-311119", + "author": "notmember", + "permlink": "notmember-hive-311119", + "title": "notmember This post will BE muted", + "body": "community type 3, notmember This post will BE muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "ismember-hive-311119", + "author": "ismember", + "permlink": "re-ismember-hive-311119", + "title": "ismember This comment will not be muted", + "body": "community type 3, ismember This comment will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "re-ismember-hive-311119", + "author": "ismember", + "permlink": "re-re-ismember-hive-311119", + "title": "ismember, depth 2 comment, This comment will not be muted", + "body": "community type 3, ismember, depth 2 comment, This comment will not be muted", + "json_metadata": "{}" + } + }, + { + "type": "comment_operation", + "value": { + "parent_author": "ismember", + "parent_permlink": "ismember-hive-311119", + "author": "notmember", + "permlink": "re-2-ismember-hive-311119", + "title": "notmember This comment will BE muted", + "body": "community type 3, notmember This comment will BE muted", + "json_metadata": "{}" + } } ] } diff --git a/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-211119_comments.pat.json b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-211119_comments.pat.json new file mode 100644 index 000000000..bf0045c86 --- /dev/null +++ b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-211119_comments.pat.json @@ -0,0 +1,153 @@ +{ + "ismember/ismember-hive-111119": { + "active_votes": [], + "author": "ismember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-111119", + "children": 3, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 0, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "ismember-hive-111119", + "post_id": 1258106, + "promoted": "0.000 HBD", + "replies": [ + "ismember/re-ismember-hive-111119", + "notmember/re-2-ismember-hive-111119" + ], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-111119/@ismember/ismember-hive-111119" + }, + "ismember/re-ismember-hive-111119": { + "active_votes": [], + "author": "ismember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-111119", + "children": 1, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 1, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "parent_author": "ismember", + "parent_permlink": "ismember-hive-111119", + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "re-ismember-hive-111119", + "post_id": 1258108, + "promoted": "0.000 HBD", + "replies": [ + "ismember/re-re-ismember-hive-111119" + ], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "RE: ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-111119/@ismember/ismember-hive-111119#@ismember/re-ismember-hive-111119" + }, + "ismember/re-re-ismember-hive-111119": { + "active_votes": [], + "author": "ismember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-111119", + "children": 0, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 2, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "parent_author": "ismember", + "parent_permlink": "re-ismember-hive-111119", + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "re-re-ismember-hive-111119", + "post_id": 1258109, + "promoted": "0.000 HBD", + "replies": [], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "RE: ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-111119/@ismember/ismember-hive-111119#@ismember/re-re-ismember-hive-111119" + }, + "notmember/re-2-ismember-hive-111119": { + "active_votes": [], + "author": "notmember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-111119", + "children": 0, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 1, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "parent_author": "ismember", + "parent_permlink": "ismember-hive-111119", + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "re-2-ismember-hive-111119", + "post_id": 1258110, + "promoted": "0.000 HBD", + "replies": [], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "RE: ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-111119/@ismember/ismember-hive-111119#@notmember/re-2-ismember-hive-111119" + } +} diff --git a/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-211119_comments.tavern.yaml b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-211119_comments.tavern.yaml new file mode 100644 index 000000000..83d3d050f --- /dev/null +++ b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-211119_comments.tavern.yaml @@ -0,0 +1,27 @@ +--- + test_name: Hivemind + + marks: + - patterntest + + includes: + - !include ../../common.yaml + + stages: + - name: test + 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_discussion" + params: {"author":"ismember", "permlink":"ismember-hive-211119"} + response: + status_code: 200 + verify_response_with: + function: validate_response:compare_response_with_pattern + extra_kwargs: + ignore_tags: "<bridge discussion>" diff --git a/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-311119_comments.pat.json b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-311119_comments.pat.json new file mode 100644 index 000000000..bf0045c86 --- /dev/null +++ b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-311119_comments.pat.json @@ -0,0 +1,153 @@ +{ + "ismember/ismember-hive-111119": { + "active_votes": [], + "author": "ismember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-111119", + "children": 3, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 0, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "ismember-hive-111119", + "post_id": 1258106, + "promoted": "0.000 HBD", + "replies": [ + "ismember/re-ismember-hive-111119", + "notmember/re-2-ismember-hive-111119" + ], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-111119/@ismember/ismember-hive-111119" + }, + "ismember/re-ismember-hive-111119": { + "active_votes": [], + "author": "ismember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-111119", + "children": 1, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 1, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "parent_author": "ismember", + "parent_permlink": "ismember-hive-111119", + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "re-ismember-hive-111119", + "post_id": 1258108, + "promoted": "0.000 HBD", + "replies": [ + "ismember/re-re-ismember-hive-111119" + ], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "RE: ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-111119/@ismember/ismember-hive-111119#@ismember/re-ismember-hive-111119" + }, + "ismember/re-re-ismember-hive-111119": { + "active_votes": [], + "author": "ismember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-111119", + "children": 0, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 2, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "parent_author": "ismember", + "parent_permlink": "re-ismember-hive-111119", + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "re-re-ismember-hive-111119", + "post_id": 1258109, + "promoted": "0.000 HBD", + "replies": [], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "RE: ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-111119/@ismember/ismember-hive-111119#@ismember/re-re-ismember-hive-111119" + }, + "notmember/re-2-ismember-hive-111119": { + "active_votes": [], + "author": "notmember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-111119", + "children": 0, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 1, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "parent_author": "ismember", + "parent_permlink": "ismember-hive-111119", + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "re-2-ismember-hive-111119", + "post_id": 1258110, + "promoted": "0.000 HBD", + "replies": [], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "RE: ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-111119/@ismember/ismember-hive-111119#@notmember/re-2-ismember-hive-111119" + } +} diff --git a/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-311119_comments.tavern.yaml b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-311119_comments.tavern.yaml new file mode 100644 index 000000000..312eec240 --- /dev/null +++ b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_discussion/hive-311119_comments.tavern.yaml @@ -0,0 +1,27 @@ +--- + test_name: Hivemind + + marks: + - patterntest + + includes: + - !include ../../common.yaml + + stages: + - name: test + 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_discussion" + params: {"author":"ismember", "permlink":"ismember-hive-311119"} + response: + status_code: 200 + verify_response_with: + function: validate_response:compare_response_with_pattern + extra_kwargs: + ignore_tags: "<bridge discussion>" diff --git a/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_2111119.pat.json b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_2111119.pat.json new file mode 100644 index 000000000..7fff1bcd8 --- /dev/null +++ b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_2111119.pat.json @@ -0,0 +1,72 @@ +[ + { + "active_votes": [], + "author": "notmember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "community type 2", + "category": "hive-211119", + "children": 0, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 0, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "notmember-hive-211119", + "post_id": 1258112, + "promoted": "0.000 HBD", + "replies": [], + "stats": { + "flag_weight": 0.0, + "gray": true, + "hide": false, + "total_votes": 0 + }, + "title": "notmember This post will BE muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-211119/@notmember/notmember-hive-211119" + }, + { + "active_votes": [], + "author": "ismember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "lorem ipsum", + "category": "hive-211119", + "children": 3, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 0, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "ismember-hive-211119", + "post_id": 1258111, + "promoted": "0.000 HBD", + "replies": [], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "community type 2, ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-211119/@ismember/ismember-hive-211119" + } +] diff --git a/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_2111119.tavern.yaml b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_2111119.tavern.yaml new file mode 100644 index 000000000..66b23d5c3 --- /dev/null +++ b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_2111119.tavern.yaml @@ -0,0 +1,27 @@ +--- + test_name: Hivemind + + marks: + - patterntest + + includes: + - !include ../../../common.yaml + + stages: + - name: test + 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_ranked_posts" + params: {"sort":"created", "tag":"hive-211119"} + response: + status_code: 200 + verify_response_with: + function: validate_response:compare_response_with_pattern + extra_kwargs: + ignore_tags: "<bridge posts>" diff --git a/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_3111119.pat.json b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_3111119.pat.json new file mode 100644 index 000000000..67207ad7c --- /dev/null +++ b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_3111119.pat.json @@ -0,0 +1,72 @@ +[ + { + "active_votes": [], + "author": "notmember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "community type 3", + "category": "hive-311119", + "children": 0, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 0, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "notmember-hive-311119", + "post_id": 1258122, + "promoted": "0.000 HBD", + "replies": [], + "stats": { + "flag_weight": 0.0, + "gray": true, + "hide": false, + "total_votes": 0 + }, + "title": "notmember This post will BE muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-311119/@notmember/notmember-hive-311119" + }, + { + "active_votes": [], + "author": "ismember", + "author_payout_value": "0.000 HBD", + "author_reputation": 25, + "beneficiaries": [], + "blacklists": [], + "body": "community type 3", + "category": "hive-311119", + "children": 3, + "created": "2016-09-15T19:47:54", + "curator_payout_value": "0.000 HBD", + "depth": 0, + "is_paidout": false, + "json_metadata": {}, + "max_accepted_payout": "1000000.000 HBD", + "net_rshares": 0, + "payout": 0.0, + "payout_at": "2016-09-22T19:47:54", + "pending_payout_value": "0.000 HBD", + "percent_hbd": 10000, + "permlink": "ismember-hive-311119", + "post_id": 1258121, + "promoted": "0.000 HBD", + "replies": [], + "stats": { + "flag_weight": 0.0, + "gray": false, + "hide": false, + "total_votes": 0 + }, + "title": "ismember This post will not be muted", + "updated": "2016-09-15T19:47:54", + "url": "/hive-311119/@ismember/ismember-hive-311119" + } +] diff --git a/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_3111119.tavern.yaml b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_3111119.tavern.yaml new file mode 100644 index 000000000..ea957c444 --- /dev/null +++ b/tests/api_tests/hivemind/tavern/bridge_api_patterns/get_ranked_posts/created/community_3111119.tavern.yaml @@ -0,0 +1,27 @@ +--- + test_name: Hivemind + + marks: + - patterntest + + includes: + - !include ../../../common.yaml + + stages: + - name: test + 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_ranked_posts" + params: {"sort":"created", "tag":"hive-311119"} + response: + status_code: 200 + verify_response_with: + function: validate_response:compare_response_with_pattern + extra_kwargs: + ignore_tags: "<bridge posts>" -- GitLab