ade@google.com | 46179d3 | 2010-08-21 00:00:03 +0100 | [diff] [blame^] | 1 | #!/usr/bin/python2.4 |
| 2 | # |
| 3 | # Copyright 2010 Google Inc. All Rights Reserved. |
| 4 | |
| 5 | """Discovery document tests |
| 6 | |
| 7 | Functional tests that verify we can retrieve data from existing services. |
| 8 | |
| 9 | These tests are read-only in order to ensure they're repeatable. They also |
| 10 | only work with publicly visible data in order to avoid dealing with OAuth. |
| 11 | """ |
| 12 | |
| 13 | __author__ = 'ade@google.com (Ade Oshineye)' |
| 14 | |
| 15 | from apiclient.discovery import build |
| 16 | |
| 17 | import logging |
| 18 | import unittest |
| 19 | |
| 20 | logging.basicConfig(level=logging.DEBUG) |
| 21 | |
| 22 | |
| 23 | class BuzzFunctionalTest(unittest.TestCase): |
| 24 | def test_can_get_buzz_activities_with_many_params(self): |
| 25 | buzz = build('buzz', 'v1') |
| 26 | max_results = 2 |
| 27 | activities = buzz.activities().list(userId='googlebuzz', scope='@self', |
| 28 | max_comments=max_results*2 ,max_liked=max_results*3, |
| 29 | max_results=max_results)['items'] |
| 30 | activity_count = len(activities) |
| 31 | self.assertEquals(max_results, activity_count) |