+ Fix search result 'source' parsing to properly unescape html and extract source
+ Cursor
Added the Cursor object to help with pagination within the API.
- Please see the pagination tutorial for more details.
+ Please see the pagination tutorial for more details (tutorial/t6).
This is the recommended way for using the 'page' and 'cursor' parameters.
+ Update OAuth bundled library.
- Logging removed. Having our own mini-logging system just feels like overkill.
self.api.trends_daily()
self.api.trends_weekly()
+class TweepyCursorTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api = API(BasicAuthHandler(username, password))
+ self.api.retry_count = 2
+ self.api.retry_delay = 5
+
+ def testpagecursoritems(self):
+ items = list(Cursor(self.api.user_timeline).items())
+ self.assert_(len(items) > 0)
+
+ items = list(Cursor(self.api.user_timeline, 'twitter').items(30))
+ self.assert_(len(items) == 30)
+
+ def testpagecursorpages(self):
+ pages = list(Cursor(self.api.user_timeline).pages())
+ self.assert_(len(pages) > 0)
+
+ pages = list(Cursor(self.api.user_timeline, 'twitter').pages(5))
+ self.assert_(len(pages) == 5)
+
+ def testcursorcursoritems(self):
+ items = list(Cursor(self.api.friends).items())
+ self.assert_(len(items) > 0)
+
+ items = list(Cursor(self.api.followers, 'twitter').items(30))
+ self.assert_(len(items) == 30)
+
+ def testcursorcursorpages(self):
+ pages = list(Cursor(self.api.friends).pages())
+ self.assert_(len(pages) > 0)
+
+ pages = list(Cursor(self.api.followers, 'twitter').pages(5))
+ self.assert_(len(pages) == 5)
class TweepyAuthTests(unittest.TestCase):