您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

test_provider.py 722B

12345678910111213141516171819202122232425
  1. import os
  2. import pytest
  3. from core.model_runtime.errors.validate import CredentialsValidateFailedError
  4. from core.model_runtime.model_providers.minimax.minimax import MinimaxProvider
  5. def test_validate_provider_credentials():
  6. provider = MinimaxProvider()
  7. with pytest.raises(CredentialsValidateFailedError):
  8. provider.validate_provider_credentials(
  9. credentials={
  10. "minimax_api_key": "hahahaha",
  11. "minimax_group_id": "123",
  12. }
  13. )
  14. provider.validate_provider_credentials(
  15. credentials={
  16. "minimax_api_key": os.environ.get("MINIMAX_API_KEY"),
  17. "minimax_group_id": os.environ.get("MINIMAX_GROUP_ID"),
  18. }
  19. )