diff --git a/hive/db/sql_scripts/hive_post_operations.sql b/hive/db/sql_scripts/hive_post_operations.sql index e0115ae8e62bf5d4e27752a3b607d3e254eae3d5..5edfdc91a4d5b1eb6eba4fc9696dc10a2e49f76c 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 3b0c6f49e3f3a9354545550e3d40b91a9ddaf494..7999bb588c7a1816bf41a22774d29064ec197b39 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 0000000000000000000000000000000000000000..bf0045c8661abb854f196a8b1eb3cebd9ac95c9b --- /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 0000000000000000000000000000000000000000..83d3d050f78ced1e53e657f6feaa1c3b8252d8bb --- /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 0000000000000000000000000000000000000000..bf0045c8661abb854f196a8b1eb3cebd9ac95c9b --- /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 0000000000000000000000000000000000000000..312eec240f9d9e523a86e206ef559ede5f78a13d --- /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 0000000000000000000000000000000000000000..7fff1bcd8d8e156d4d5bcbd1b78a46432e7e032a --- /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 0000000000000000000000000000000000000000..66b23d5c363771b4dbcf19f5a9fe1da2846cd665 --- /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 0000000000000000000000000000000000000000..67207ad7c0deb25980f1c2ed0719220dcbd56543 --- /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 0000000000000000000000000000000000000000..ea957c44471d98cb8f9b24b7d95e9ec56ca2ba23 --- /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>"