Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
5be12310
Commit
5be12310
authored
Jan 20, 2013
by
Joshua Roesslein
Browse files
Fix create/update/destroy lists for v1.1.
parent
5aec7a3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests.py
View file @
5be12310
...
...
@@ -244,10 +244,14 @@ class TweepyAPITests(unittest.TestCase):
self
.
api
.
blocks_ids
()
def
testcreateupdatedestroylist
(
self
):
self
.
api
.
create_list
(
'tweeps'
)
# XXX: right now twitter throws a 500 here, issue is being looked into by twitter.
#self.api.update_list('tweeps', mode='private')
self
.
api
.
destroy_list
(
'tweeps'
)
params
=
{
'owner_screen_name'
:
username
,
'slug'
:
'tweeps'
}
self
.
api
.
create_list
(
name
=
params
[
'slug'
],
**
params
)
l
=
self
.
api
.
update_list
(
description
=
'updated!'
,
**
params
)
self
.
assertEqual
(
l
.
description
,
'updated!'
)
self
.
api
.
destroy_list
(
**
params
)
def
testlists
(
self
):
self
.
api
.
lists
()
...
...
tweepy/api.py
View file @
5be12310
...
...
@@ -533,31 +533,29 @@ class API(object):
return
False
return
True
def
create_list
(
self
,
*
args
,
**
kargs
):
return
bind_api
(
path
=
'/%s/lists.json'
%
self
.
auth
.
get_username
(),
method
=
'POST'
,
payload_type
=
'list'
,
allowed_param
=
[
'name'
,
'mode'
,
'description'
],
require_auth
=
True
)(
self
,
*
args
,
**
kargs
)
create_list
=
bind_api
(
path
=
'/lists/create.json'
,
method
=
'POST'
,
payload_type
=
'list'
,
allowed_param
=
[
'name'
,
'mode'
,
'description'
],
require_auth
=
True
)
def
destroy_list
(
self
,
slug
):
return
bind_api
(
path
=
'/%s/lists/%s.json'
%
(
self
.
auth
.
get_username
(),
slug
)
,
method
=
'DELETE
'
,
payload_type
=
'list'
,
require_auth
=
True
)(
self
)
destroy_list
=
bind_api
(
path
=
'/lists/destroy.json'
,
method
=
'POST'
,
payload_type
=
'list
'
,
allowed_param
=
[
'owner_screen_name'
,
'owner_id'
,
'list_id'
,
'slug'
]
,
require_auth
=
True
)
def
update_list
(
self
,
slug
,
*
args
,
**
kargs
):
return
bind_api
(
path
=
'/%s/lists/%s.json'
%
(
self
.
auth
.
get_username
(),
slug
),
method
=
'POST'
,
payload_type
=
'list'
,
allowed_param
=
[
'name'
,
'mode'
,
'description'
],
require_auth
=
True
)(
self
,
*
args
,
**
kargs
)
update_list
=
bind_api
(
path
=
'/lists/update.json'
,
method
=
'POST'
,
payload_type
=
'list'
,
allowed_param
=
[
'list_id'
,
'slug'
,
'name'
,
'mode'
,
'description'
,
'owner_screen_name'
,
'owner_id'
],
require_auth
=
True
)
lists
=
bind_api
(
path
=
'/{user}/lists.json'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment