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
1ff1ea7e
Commit
1ff1ea7e
authored
Jul 29, 2009
by
Josh Roesslein
Browse files
Restructure repository layout. Fixed test errors.
parent
4d85f40c
Changes
7
Show whitespace changes
Inline
Side-by-side
tests.py
View file @
1ff1ea7e
...
...
@@ -5,8 +5,7 @@
import
unittest
import
random
from
api
import
API
from
models
import
*
from
tweepy
import
*
"""Unit tests"""
...
...
@@ -19,7 +18,6 @@ class TweepyAPITests(unittest.TestCase):
def
setUp
(
self
):
self
.
api
=
API
(
self
.
username
,
self
.
password
)
self
.
update_status_id
=
None
def
testsetcredentials
(
self
):
testapi
=
API
()
...
...
@@ -53,21 +51,20 @@ class TweepyAPITests(unittest.TestCase):
self
.
assert_
(
isinstance
(
s
,
Status
))
self
.
assertEqual
(
s
.
user
.
id
,
17
)
def
testupdatestatus
(
self
):
def
testupdateanddestroystatus
(
self
):
# test update
text
=
'testing %i'
%
random
.
randint
(
0
,
1000
)
update
=
self
.
api
.
update_status
(
'
status
'
=
text
)
update
=
self
.
api
.
update_status
(
status
=
text
)
self
.
assert_
(
isinstance
(
update
,
Status
))
self
.
assertEqual
(
update
.
text
,
text
)
self
.
update_status_id
=
update
.
id
def
testdestroystatus
(
self
):
self
.
assert_
(
self
.
update_status_id
)
deleted
=
self
.
api
.
destroy_status
(
id
=
self
.
update_status_id
)
# test destroy
deleted
=
self
.
api
.
destroy_status
(
id
=
update
.
id
)
self
.
assert_
(
isinstance
(
deleted
,
Status
))
self
.
assertEqual
(
deleted
.
id
,
self
.
update
_status_
id
)
self
.
assertEqual
(
deleted
.
id
,
update
.
id
)
def
test
show
user
(
self
):
u
=
self
.
api
.
show
_user
(
screen_name
=
'twitter'
)
def
test
get
user
(
self
):
u
=
self
.
api
.
get
_user
(
screen_name
=
'twitter'
)
self
.
assert_
(
isinstance
(
u
,
User
))
self
.
assertEqual
(
u
.
screen_name
,
'twitter'
)
...
...
__init__.py
→
tweepy/
__init__.py
View file @
1ff1ea7e
File moved
api.py
→
tweepy/
api.py
View file @
1ff1ea7e
File moved
binder.py
→
tweepy/
binder.py
View file @
1ff1ea7e
File moved
error.py
→
tweepy/
error.py
View file @
1ff1ea7e
File moved
models.py
→
tweepy/
models.py
View file @
1ff1ea7e
File moved
parsers.py
→
tweepy/
parsers.py
View file @
1ff1ea7e
File moved
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