Set httplib2.RETRIES to 1.

Reviewed in https://codereview.appspot.com/6906051/.
This commit is contained in:
Joe Gregorio
2012-12-07 14:14:26 -05:00
parent 83f2ee6401
commit 504a17fa87
2 changed files with 9 additions and 0 deletions

View File

@@ -59,6 +59,9 @@ from email.mime.nonmultipart import MIMENonMultipart
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('{[^}]*}')

View File

@@ -89,6 +89,12 @@ def datafile(filename):
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'))