Fixes for some coverage tests. Also fix functional test, and make verbosity controls apply better.
This commit is contained in:
@@ -30,9 +30,9 @@ import urllib
|
|||||||
import urlparse
|
import urlparse
|
||||||
from apiclient.http import HttpRequest
|
from apiclient.http import HttpRequest
|
||||||
|
|
||||||
try:
|
try: # pragma: no cover
|
||||||
import simplejson
|
import simplejson
|
||||||
except ImportError:
|
except ImportError: # pragma: no cover
|
||||||
try:
|
try:
|
||||||
# Try to import from django, should work on App Engine
|
# Try to import from django, should work on App Engine
|
||||||
from django.utils import simplejson
|
from django.utils import simplejson
|
||||||
|
@@ -27,9 +27,13 @@ class BuzzFunctionalTest(unittest.TestCase):
|
|||||||
actcol = buzz.activities()
|
actcol = buzz.activities()
|
||||||
activities = actcol.list(userId='googlebuzz', scope='@self',
|
activities = actcol.list(userId='googlebuzz', scope='@self',
|
||||||
max_comments=max_results*2 ,max_liked=max_results*3,
|
max_comments=max_results*2 ,max_liked=max_results*3,
|
||||||
max_results=max_results).execute()['items']
|
max_results=max_results).execute()
|
||||||
activity_count = len(activities)
|
activity_count = len(activities['items'])
|
||||||
self.assertEquals(max_results, activity_count)
|
self.assertEquals(max_results, activity_count)
|
||||||
|
|
||||||
activities = actcol.list_next(activities)
|
activities = actcol.list_next(activities).execute()
|
||||||
self.assertEquals(activities, None) # Public streams don't have next links
|
activity_count = len(activities['items'])
|
||||||
|
self.assertEquals(max_results, activity_count)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
|
@@ -31,8 +31,9 @@ elif verbosity == 2:
|
|||||||
def build_suite(folder):
|
def build_suite(folder):
|
||||||
# find all of the test modules
|
# find all of the test modules
|
||||||
modules = map(fullmodname, glob.glob(os.path.join(folder, 'test_*.py')))
|
modules = map(fullmodname, glob.glob(os.path.join(folder, 'test_*.py')))
|
||||||
print "Running the tests found in the following modules:"
|
if verbosity > 0:
|
||||||
print modules
|
print "Running the tests found in the following modules:"
|
||||||
|
print modules
|
||||||
|
|
||||||
# load all of the tests into a suite
|
# load all of the tests into a suite
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user