]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
If oauth2client isn't present, skip Google Storage tests rather than blowing up.
authorItamar Turner-Trauring <itamar@futurefoundries.com>
Tue, 5 Mar 2013 17:01:06 +0000 (12:01 -0500)
committerDaira Hopwood <daira@jacaranda.org>
Fri, 10 Jul 2015 04:24:47 +0000 (05:24 +0100)
src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py
src/allmydata/test/test_storage.py

index af3a82a9437acf314962d8fccc14b94d300545e5..cf6f1537faa9b8bcd5ab99d94543c612020f0307 100644 (file)
@@ -18,7 +18,12 @@ from twisted.internet.defer import DeferredLock
 from twisted.internet.threads import deferToThread
 from twisted.web.http import UNAUTHORIZED
 
-from oauth2client.client import SignedJwtAssertionCredentials
+try:
+    from oauth2client.client import SignedJwtAssertionCredentials
+    oauth2client_available = True
+except ImportError:
+    oauth2client_available = False
+    SignedJwtAssertionCredentials = None
 
 from zope.interface import implements
 
index 77fcd5bfdbe9b71acd36e8e5d1310b1dc07285a2..9ffce02d85bcfc1c2ba6647f0c8c2c841fc3d0ca 100644 (file)
@@ -642,6 +642,9 @@ class GoogleStorageAuthenticationClient(unittest.TestCase):
     unless noted otherwise.
     """
 
+    if not googlestorage_container.oauth2client_available:
+        skip = "Google Storage requires oauth2client"
+
     def test_credentials(self):
         """
         AuthenticationClient.get_authorization_header() initializes a
@@ -766,6 +769,9 @@ class GoogleStorageBackend(unittest.TestCase):
     allmydata.storage.backends.cloud.googlestorage.googlestorage_container
     unless noted otherwise.
     """
+    if not googlestorage_container.oauth2client_available:
+        skip = "Google Storage requires oauth2client"
+
     class Response(object):
         def __init__(self, code, headers={}):
             self.code = code