def testGetUserTimeline(self):
'''Test the twitter.Api GetUserTimeline method'''
self._AddHandler('https://api.twitter.com/1.1/statuses/user_timeline.json?count=1&screen_name=kesuke',
curry(self._OpenTestData, 'user_timeline-kesuke.json'))
statuses = self._api.GetUserTimeline(screen_name='kesuke', count=1)
# This is rather arbitrary, but spot checking is better than nothing
self.assertEqual(89512102, statuses[0].id)
self.assertEqual(718443, statuses[0].user.id)
#def testGetFriendsTimeline(self):
# '''Test the twitter.Api GetFriendsTimeline method'''
# self._AddHandler('https://api.twitter.com/1.1/statuses/friends_timeline/kesuke.json',
# curry(self._OpenTestData, 'friends_timeline-kesuke.json'))
# statuses = self._api.GetFriendsTimeline('kesuke')
# # This is rather arbitrary, but spot checking is better than nothing
# self.assertEqual(20, len(statuses))
# self.assertEqual(718443, statuses[0].user.id)
评论列表
文章目录