def test_exchange_credential_missing_service_account_info(
    service_account_exchanger, auth_scheme
):
  """Test missing service account info during exchange."""
  auth_credential = AuthCredential(
      auth_type=AuthCredentialTypes.SERVICE_ACCOUNT,
  )
  with pytest.raises(AuthCredentialMissingError) as exc_info:
    service_account_exchanger.exchange_credential(auth_scheme, auth_credential)
  assert "Service account credentials are missing" in str(exc_info.value)
Test missing service account info during exchange.
tests/unittests/tools/openapi_tool/auth/credential_exchangers/test_service_account_exchanger.py