Fixes for some coverage tests. Also fix functional test, and make verbosity controls apply better.
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index 9eec549..3d30fbd 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -30,9 +30,9 @@
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
diff --git a/functional_tests/test_services.py b/functional_tests/test_services.py
index e82ec24..ae197ba 100644
--- a/functional_tests/test_services.py
+++ b/functional_tests/test_services.py
@@ -27,9 +27,13 @@
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()
diff --git a/runtests.py b/runtests.py
index 4502baf..d12b2c5 100644
--- a/runtests.py
+++ b/runtests.py
@@ -31,8 +31,9 @@
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: