コード例 #1
0
ファイル: sdk_test_base.py プロジェクト: bopopescu/gcloud_cli
 def _FakeAuthCredential(self, use_google_auth):
   if use_google_auth:
     cred = gce_google_auth.Credentials()
     cred.token = self.FakeAuthAccessToken()
     return cred
   cred = gce.AppAssertionCredentials([])
   cred.access_token = self.FakeAuthAccessToken()
   return cred
コード例 #2
0
ファイル: test_connectors.py プロジェクト: bbc/foxglove
def test_gcs_credentials_passed_to_client(fake_storage_client: MagicMock):
    fake_credentials = credentials.Credentials()
    project = 'some_project'
    engine_url = f'gs+flowerpot://{project}.fake_flowerpot_bucket/some_file.json'
    GcsFlowerpotConnector(engine_url=engine_url,
                          access=AccessMode.READ,
                          credentials=fake_credentials)
    fake_storage_client.assert_called_with(project, fake_credentials)
コード例 #3
0
 def credentials_fixture(self):
     self.credentials = credentials.Credentials()
コード例 #4
0
 def testIsGceAccountCredentials(self):
     oauth2client_cred = oauth2client_gce.AppAssertionCredentials()
     google_auth_cred = google_auth_gce_creds.Credentials()
     self.assertTrue(auth_util.IsGceAccountCredentials(oauth2client_cred))
     self.assertTrue(auth_util.IsGceAccountCredentials(google_auth_cred))