Set httplib2.RETRIES to 1.
Reviewed in https://codereview.appspot.com/6906051/.
This commit is contained in:
@@ -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('{[^}]*}')
|
||||
|
||||
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user