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
|
||||
from apiclient.http import HttpRequest
|
||||
|
||||
try:
|
||||
try: # pragma: no cover
|
||||
import simplejson
|
||||
except ImportError:
|
||||
except ImportError: # pragma: no cover
|
||||
try:
|
||||
# Try to import from django, should work on App Engine
|
||||
from django.utils import simplejson
|
||||
|
@@ -27,9 +27,13 @@ class BuzzFunctionalTest(unittest.TestCase):
|
||||
actcol = buzz.activities()
|
||||
activities = actcol.list(userId='googlebuzz', scope='@self',
|
||||
max_comments=max_results*2 ,max_liked=max_results*3,
|
||||
max_results=max_results).execute()['items']
|
||||
activity_count = len(activities)
|
||||
max_results=max_results).execute()
|
||||
activity_count = len(activities['items'])
|
||||
self.assertEquals(max_results, activity_count)
|
||||
|
||||
activities = actcol.list_next(activities)
|
||||
self.assertEquals(activities, None) # Public streams don't have next links
|
||||
activities = actcol.list_next(activities).execute()
|
||||
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):
|
||||
# find all of the test modules
|
||||
modules = map(fullmodname, glob.glob(os.path.join(folder, 'test_*.py')))
|
||||
print "Running the tests found in the following modules:"
|
||||
print modules
|
||||
if verbosity > 0:
|
||||
print "Running the tests found in the following modules:"
|
||||
print modules
|
||||
|
||||
# load all of the tests into a suite
|
||||
try:
|
||||
|
Reference in New Issue
Block a user