self.api.get_list('applepie', 'stars')
def testaddremovelistmember(self):
- uid = self.api.get_user('twitter').id
- self.api.add_list_member('test', uid)
- self.api.remove_list_member('test', uid)
+ params = {
+ 'slug': 'test',
+ 'owner_screen_name': username,
+ 'screen_name': 'twitter'
+ }
+
+ def assert_list(l):
+ self.assertEqual(l.name, params['slug'])
+
+ assert_list(self.api.add_list_member(**params))
+ assert_list(self.api.remove_list_member(**params))
def testlistmembers(self):
self.api.list_members('applepie', 'stars')
allowed_param = ['owner', 'slug']
)
- def add_list_member(self, slug, *args, **kargs):
- return bind_api(
- path = '/%s/%s/members.json' % (self.auth.get_username(), slug),
- method = 'POST',
- payload_type = 'list',
- allowed_param = ['id'],
- require_auth = True
- )(self, *args, **kargs)
+ add_list_member = bind_api(
+ path = '/lists/members/create.json',
+ method = 'POST',
+ payload_type = 'list',
+ allowed_param = ['screen_name', 'user_id', 'owner_screen_name', 'owner_id', 'slug', 'list_id'],
+ require_auth = True
+ )
- def remove_list_member(self, slug, *args, **kargs):
- return bind_api(
- path = '/%s/%s/members.json' % (self.auth.get_username(), slug),
- method = 'DELETE',
- payload_type = 'list',
- allowed_param = ['id'],
- require_auth = True
- )(self, *args, **kargs)
+ remove_list_member = bind_api(
+ path = '/lists/members/destroy.json',
+ method = 'POST',
+ payload_type = 'list',
+ allowed_param = ['screen_name', 'user_id', 'owner_screen_name', 'owner_id', 'slug', 'list_id'],
+ require_auth = True
+ )
list_members = bind_api(
path = '/{owner}/{slug}/members.json',