def test__googleauth(self):
"""
TODO(supertom): add mocking, make more robust, etc.
This test make a lot of assumptions:
1. Running on GCE
3. Doesn't truly verify the Http object is authorized.
However, this function is critical for valid GCP operation
so it is good to have a sanity check that we have an Http object.
"""
from httplib2 import Http
# default creds
http_auth = auth._googleauth()
self.assertTrue(isinstance(http_auth, Http))
# service account key
test_key_file = self._get_fixture('testkey.json')
http_auth = auth._googleauth(key_file=test_key_file)
self.assertTrue(isinstance(http_auth, Http))
评论列表
文章目录