merge
This commit is contained in:
@@ -13,13 +13,9 @@ only work with publicly visible data in order to avoid dealing with OAuth.
|
|||||||
__author__ = 'ade@google.com (Ade Oshineye)'
|
__author__ = 'ade@google.com (Ade Oshineye)'
|
||||||
|
|
||||||
from apiclient.discovery import build
|
from apiclient.discovery import build
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
|
|
||||||
|
|
||||||
class BuzzFunctionalTest(unittest.TestCase):
|
class BuzzFunctionalTest(unittest.TestCase):
|
||||||
def test_can_get_buzz_activities_with_many_params(self):
|
def test_can_get_buzz_activities_with_many_params(self):
|
||||||
buzz = build('buzz', 'v1')
|
buzz = build('buzz', 'v1')
|
||||||
@@ -35,5 +31,17 @@ class BuzzFunctionalTest(unittest.TestCase):
|
|||||||
activity_count = len(activities['items'])
|
activity_count = len(activities['items'])
|
||||||
self.assertEquals(max_results, activity_count)
|
self.assertEquals(max_results, activity_count)
|
||||||
|
|
||||||
|
def test_can_page_through_users_activities(self):
|
||||||
|
buzz = build('buzz', 'v1')
|
||||||
|
max_results = 2
|
||||||
|
actcol = buzz.activities()
|
||||||
|
|
||||||
|
activities = actcol.list(userId='adewale', scope='@self',
|
||||||
|
max_results=max_results).execute()
|
||||||
|
for count in range(10):
|
||||||
|
activities = actcol.list_next(activities).execute()
|
||||||
|
activity_count = len(activities['items'])
|
||||||
|
self.assertEquals(max_results, activity_count, 'Failed after %s pages' % str(count))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user