test_auth.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:cloudaux 作者: Netflix-Skunkworks 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号