(client_cls: type[Client], tmp_path: Path)
| 225 | |
| 226 | @pytest.mark.parametrize("client_cls", [BedrockOpenAI, AsyncBedrockOpenAI]) |
| 227 | def test_aws_profile_supplies_region(client_cls: type[Client], tmp_path: Path) -> None: |
| 228 | config_path = tmp_path / "config" |
| 229 | config_path.write_text("[profile production]\nregion = eu-central-1\n") |
| 230 | with update_env( |
| 231 | AWS_CONFIG_FILE=str(config_path), |
| 232 | AWS_BEDROCK_BASE_URL=Omit(), |
| 233 | AWS_REGION=Omit(), |
| 234 | AWS_DEFAULT_REGION=Omit(), |
| 235 | ): |
| 236 | client = ( |
| 237 | make_sync_client(aws_profile="production") |
| 238 | if client_cls is BedrockOpenAI |
| 239 | else make_async_client(aws_profile="production") |
| 240 | ) |
| 241 | |
| 242 | assert client.aws_region == "eu-central-1" |
| 243 | assert client.base_url == URL("https://bedrock-mantle.eu-central-1.api.aws/openai/v1/") |
| 244 | |
| 245 | |
| 246 | @pytest.mark.parametrize("client_cls", [BedrockOpenAI, AsyncBedrockOpenAI]) |
nothing calls this directly
no test coverage detected