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
05f4ab18
Commit
05f4ab18
authored
Jun 09, 2013
by
Joshua Roesslein
Browse files
Add tests for ResultSet.
parent
3619126a
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_resultset.py
0 → 100644
View file @
05f4ab18
import
unittest
from
tweepy.models
import
ResultSet
class
NoIdItem
(
object
):
pass
class
IdItem
(
object
):
def
__init__
(
self
,
id
):
self
.
id
=
id
ids_fixture
=
[
1
,
10
,
8
,
50
,
2
,
100
,
5
]
class
TweepyResultSetTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
results
=
ResultSet
()
for
i
in
ids_fixture
:
self
.
results
.
append
(
IdItem
(
i
))
self
.
results
.
append
(
NoIdItem
())
def
testids
(
self
):
ids
=
self
.
results
.
ids
()
self
.
assertListEqual
(
ids
,
ids_fixture
)
def
testmaxid
(
self
):
self
.
assertEqual
(
self
.
results
.
max_id
,
100
)
def
testsinceid
(
self
):
self
.
assertEqual
(
self
.
results
.
since_id
,
1
)
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