From e1abac0f0fa1a445118737f939e3d9a619a24eb3 Mon Sep 17 00:00:00 2001 From: Ousama Ben Younes Date: Tue, 7 Jul 2026 20:19:47 +0000 Subject: [PATCH] test(providers): cover wrapped bedrock import errors --- tests/test_provider_hints.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_provider_hints.py b/tests/test_provider_hints.py index 4ec4366c..7849aa58 100644 --- a/tests/test_provider_hints.py +++ b/tests/test_provider_hints.py @@ -11,6 +11,7 @@ VERTEX_EXTRA_NAME = "vertex" BEDROCK_EXTRA_NAME = "bedrock" INSTALL_EXTRA_COMMAND_FRAGMENT = 'pipx install "strix-agent[' WRAPPED_VERTEX_GOOGLE_ERROR = "litellm.APIConnectionError: No module named 'google'" +WRAPPED_BEDROCK_BOTO3_ERROR = "litellm.APIConnectionError: No module named 'boto3'" def test_bedrock_boto3_hint() -> None: @@ -37,6 +38,14 @@ def test_vertex_google_hint_for_litellm_wrapped_connection_error() -> None: assert VERTEX_EXTRA_NAME in hint +def test_bedrock_boto3_hint_for_litellm_wrapped_connection_error() -> None: + exc = ConnectionError(WRAPPED_BEDROCK_BOTO3_ERROR) + hint = _provider_import_hint(exc, BEDROCK_MODEL) + assert hint is not None + assert INSTALL_EXTRA_COMMAND_FRAGMENT in hint + assert BEDROCK_EXTRA_NAME in hint + + def test_non_import_error_returns_none() -> None: assert _provider_import_hint(ConnectionError("boom"), "bedrock/whatever") is None