Set httplib2.RETRIES to 1.
Reviewed in https://codereview.appspot.com/6906051/.
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index ea61919..eb179ff 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -59,6 +59,9 @@
from oauth2client.util import positional
from oauth2client.anyjson import simplejson
+# The client library requires a version of httplib2 that supports RETRIES.
+httplib2.RETRIES = 1
+
logger = logging.getLogger(__name__)
URITEMPLATE = re.compile('{[^}]*}')
diff --git a/tests/test_discovery.py b/tests/test_discovery.py
index 180aa3c..b2ee56c 100644
--- a/tests/test_discovery.py
+++ b/tests/test_discovery.py
@@ -89,6 +89,12 @@
return os.path.join(DATA_DIR, filename)
+class SetupHttplib2(unittest.TestCase):
+ def test_retries(self):
+ # Merely loading apiclient.discovery should set the RETRIES to 1.
+ self.assertEqual(1, httplib2.RETRIES)
+
+
class Utilities(unittest.TestCase):
def test_key2param(self):
self.assertEqual('max_results', key2param('max-results'))