commit
e38f6ade74
3 changed files with 63 additions and 0 deletions
|
|
@ -54,3 +54,4 @@ Patches and Suggestions
|
|||
- `Mertcan Mermerkaya <https://github.com/mmermerkaya>`_, Fixed code example in documentation
|
||||
- `Donne Martin <https://github.com/donnemartin>`_, Fixed typos in `README.rst`
|
||||
- `Diego Allen <https://github.com/dalleng>`_, Add missing comma in documentation code snippet
|
||||
- `Ben McGinnes <https://github.com/Hasimir>`_, Added mute API endpoints, a couple of examples, random bits.
|
||||
|
|
|
|||
|
|
@ -305,6 +305,28 @@ class TwythonEndpointsTestCase(unittest.TestCase):
|
|||
we have not uploaded a profile banner"""
|
||||
self.assertRaises(TwythonError, self.api.get_profile_banner_sizes)
|
||||
|
||||
@unittest.skip('skipping non-updated test')
|
||||
def test_list_mutes(self):
|
||||
"""Test listing users who are muted by the authenticated user
|
||||
succeeds"""
|
||||
self.api.list_mutes()
|
||||
|
||||
@unittest.skip('skipping non-updated test')
|
||||
def test_list_mute_ids(self):
|
||||
"""Test listing user ids who are muted by the authenticated user
|
||||
succeeds"""
|
||||
self.api.list_mute_ids()
|
||||
|
||||
@unittest.skip('skipping non-updated test')
|
||||
def test_create_mute(self):
|
||||
"""Test muting a user succeeds"""
|
||||
self.api.create_mute(screen_name='justinbieber')
|
||||
|
||||
@unittest.skip('skipping non-updated test')
|
||||
def test_destroy_mute(self):
|
||||
"""Test muting a user succeeds"""
|
||||
self.api.destroy_mute(screen_name='justinbieber')
|
||||
|
||||
# Suggested Users
|
||||
@unittest.skip('skipping non-updated test')
|
||||
def test_get_user_suggestions_by_slug(self):
|
||||
|
|
|
|||
|
|
@ -523,6 +523,46 @@ class EndpointsMixin(object):
|
|||
"""
|
||||
return self.get('users/profile_banner', params=params)
|
||||
|
||||
def list_mutes(self, **params):
|
||||
"""Returns a collection of user objects that the authenticating user
|
||||
is muting.
|
||||
|
||||
Docs: https://dev.twitter.com/docs/api/1.1/get/mutes/users/list
|
||||
|
||||
"""
|
||||
return self.get('mutes/users/list', params=params)
|
||||
list_mutes.iter_mode = 'cursor'
|
||||
list_mutes.iter_key = 'users'
|
||||
|
||||
def list_mute_ids(self, **params):
|
||||
"""Returns an array of numeric user ids the authenticating user
|
||||
is muting.
|
||||
|
||||
Docs: https://dev.twitter.com/docs/api/1.1/get/mutes/users/ids
|
||||
|
||||
"""
|
||||
return self.get('mutes/users/ids', params=params)
|
||||
list_mute_ids.iter_mode = 'cursor'
|
||||
list_mute_ids.iter_key = 'ids'
|
||||
|
||||
def create_mute(self, **params):
|
||||
"""Mutes the specified user, preventing their tweets appearing
|
||||
in the authenticating user's timeline.
|
||||
|
||||
Docs: https://dev.twitter.com/docs/api/1.1/post/mutes/users/create
|
||||
|
||||
"""
|
||||
return self.post('mutes/users/create', params=params)
|
||||
|
||||
def destroy_mute(self, **params):
|
||||
"""Un-mutes the user specified in the user or ID parameter for
|
||||
the authenticating user.
|
||||
|
||||
Docs: https://dev.twitter.com/docs/api/1.1/post/mutes/users/destroy
|
||||
|
||||
"""
|
||||
return self.post('mutes/users/destroy', params=params)
|
||||
|
||||
# Suggested Users
|
||||
def get_user_suggestions_by_slug(self, **params):
|
||||
"""Access the users in a given category of the Twitter suggested user list.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue