Skip to content

Commit 4316bec

Browse files
committed
Added follow_suggestions for client and tests
1 parent f54e772 commit 4316bec

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎stream/client.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ def add_to_many(self, activity, feeds):
225225
data = {'activity': activity, 'feeds': feeds}
226226
self._make_signed_request('post', 'feed/add_to_many/', data=data)
227227

228+
def follow_suggestions(self, user_id, limit=20):
229+
'''
230+
Get follow suggestions for the given user
231+
:param user_id: the user id for who to get follow suggestions
232+
'''
233+
self._make_signed_request('get', 'follow_suggestions/%s/' % user_id, params=dict(limit=limit))
234+
235+
228236
def follow_many(self, follows):
229237
'''
230238
Creates many follows

‎stream/tests.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ def test_add_activity_to(self):
177177
# and the flat feed
178178
activities = team_follower_feed.get(limit=1)['results']
179179
self.assertFirstActivityIDNotEqual(activities, activity_id)
180-
180+
181+
def test_get_follow_suggestions(self):
182+
user_id = '13'
183+
suggestions = client.follow_suggestions(user_id)
184+
181185
def assertFirstActivityIDEqual(self, activities, correct_activity_id):
182186
activity_id = None
183187
if activities:

0 commit comments

Comments
 (0)