Skip to content

Commit

Permalink
Add test for include_shares
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelOtter committed Oct 21, 2023
1 parent 84a7b5a commit 311b911
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions granary/tests/test_bluesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@
},
'object': POST_AUTHOR_PROFILE_AS['object'],
}
REPOST_PROFILE_AS = copy.deepcopy(REPOST_AS)
REPOST_PROFILE_AS['actor'].update({
'username': 'bob.com',
'url': 'https://bsky.app/profile/bob.com',
})

REPOST_BSKY = {
'$type': 'app.bsky.feed.repost',
'subject': {
Expand Down Expand Up @@ -948,6 +954,18 @@ def test_get_activities_with_reposts(self, mock_get):
},
)

@patch('requests.get')
def test_get_activities_include_shares(self, mock_get):
mock_get.return_value = requests_response({
'cursor': 'timestamp::cid',
'feed': [POST_FEED_VIEW_BSKY, REPOST_BSKY_FEED_VIEW_POST],
})

self.assert_equals(
[POST_AUTHOR_PROFILE_AS, REPOST_PROFILE_AS],
self.bs.get_activities(include_shares=True)
)


@patch('requests.get')
def test_get_comment(self, mock_get):
Expand Down

0 comments on commit 311b911

Please sign in to comment.