16 lines
479 B
Python
Raw Normal View History

2024-08-08 06:23:08 +00:00
import os
import pytest
from core.model_runtime.errors.validate import CredentialsValidateFailedError
from core.model_runtime.model_providers.zhinao.zhinao import ZhinaoProvider
def test_validate_provider_credentials():
provider = ZhinaoProvider()
with pytest.raises(CredentialsValidateFailedError):
provider.validate_provider_credentials(credentials={})
2024-08-08 06:23:08 +00:00
provider.validate_provider_credentials(credentials={"api_key": os.environ.get("ZHINAO_API_KEY")})