mirror of
https://github.com/langgenius/dify.git
synced 2025-07-16 05:35:09 +00:00

Co-authored-by: takatost <takatost@users.noreply.github.com> Co-authored-by: Garfield Dai <dai.hai@foxmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: Charlie.Wei <luowei@cvte.com> Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: Benjamin <benjaminx@gmail.com>
22 lines
665 B
Python
22 lines
665 B
Python
import os
|
|
|
|
import pytest
|
|
from core.model_runtime.errors.validate import CredentialsValidateFailedError
|
|
from core.model_runtime.model_providers.bedrock.bedrock import BedrockProvider
|
|
|
|
def test_validate_provider_credentials():
|
|
provider = BedrockProvider()
|
|
|
|
with pytest.raises(CredentialsValidateFailedError):
|
|
provider.validate_provider_credentials(
|
|
credentials={}
|
|
)
|
|
|
|
provider.validate_provider_credentials(
|
|
credentials={
|
|
"aws_region": os.getenv("AWS_REGION"),
|
|
"aws_access_key": os.getenv("AWS_ACCESS_KEY"),
|
|
"aws_secret_access_key": os.getenv("AWS_SECRET_ACCESS_KEY")
|
|
}
|
|
)
|