fix(lint): apply ruff format to anthropic/google/consolidated step files
CI / push-validation (pull_request) Successful in 30s
CI / lint (pull_request) Successful in 41s
CI / helm (pull_request) Successful in 46s
CI / build (pull_request) Successful in 51s
CI / quality (pull_request) Successful in 54s
CI / typecheck (pull_request) Successful in 1m16s
CI / security (pull_request) Successful in 1m25s
CI / unit_tests (pull_request) Successful in 5m36s
CI / integration_tests (pull_request) Successful in 10m20s
CI / docker (pull_request) Successful in 1m42s
CI / coverage (pull_request) Successful in 11m27s
CI / status-check (pull_request) Successful in 9s

This commit is contained in:
2026-06-04 19:25:49 -04:00
parent 9b6bedb463
commit c56601eaf5
3 changed files with 28 additions and 12 deletions
+12 -4
View File
@@ -153,7 +153,9 @@ def step_stream_plan_generation(context):
'the Anthropic provider should construct ChatAnthropic with api key "{api_key}" and model "{model_id}"'
)
def step_assert_chat_anthropic_constructor(context, api_key, model_id):
assert context.chat_anthropic_call is not None, "ChatAnthropic should have been called"
assert context.chat_anthropic_call is not None, (
"ChatAnthropic should have been called"
)
call_args, call_kwargs = context.chat_anthropic_call
assert call_args == (), "ChatAnthropic should be called with keyword arguments"
assert call_kwargs["api_key"] == api_key
@@ -170,7 +172,9 @@ def step_assert_chat_anthropic_constructor(context, api_key, model_id):
'the Anthropic provider should include kwargs "{kwargs_string}" in the ChatAnthropic call'
)
def step_assert_chat_anthropic_kwargs(context, kwargs_string):
assert context.chat_anthropic_call is not None, "ChatAnthropic should have been called"
assert context.chat_anthropic_call is not None, (
"ChatAnthropic should have been called"
)
_, call_kwargs = context.chat_anthropic_call
expected_kwargs = _parse_kwargs_string(kwargs_string)
for key, value in expected_kwargs.items():
@@ -193,7 +197,9 @@ def step_assert_provider_metadata(context, expected_name, expected_model):
assert response.model_used == expected_model
@then("the Anthropic provider response should report the requested model without errors")
@then(
"the Anthropic provider response should report the requested model without errors"
)
def step_assert_placeholder_metadata(context):
assert context.response is not None
assert context.response.model_used == context.provider.model_id
@@ -262,4 +268,6 @@ def step_assert_anthropic_provider_error(context, message):
def step_assert_anthropic_supports_streaming(context):
provider = getattr(context, "provider", None)
assert provider is not None, "Provider should exist"
assert provider._supports_streaming is True, "Anthropic provider should support streaming"
assert provider._supports_streaming is True, (
"Anthropic provider should support streaming"
)
@@ -55,7 +55,9 @@ def step_create_anthropic_provider_with_custom_overrides(context, api_key, model
@then("the Anthropic provider should apply the custom overrides to ChatAnthropic")
def step_assert_anthropic_custom_overrides(context):
assert context.chat_anthropic_call is not None, "ChatAnthropic should have been called"
assert context.chat_anthropic_call is not None, (
"ChatAnthropic should have been called"
)
_, call_kwargs = context.chat_anthropic_call
overrides = getattr(context, "anthropic_custom_overrides", {})
for key, value in overrides.items():
+13 -7
View File
@@ -90,9 +90,7 @@ def step_set_google_provider_kwargs(context, kwargs_string):
@given(
'I create a Google chat provider with API key "{api_key}" and model "{model_id}"'
)
@when(
'I create a Google chat provider with API key "{api_key}" and model "{model_id}"'
)
@when('I create a Google chat provider with API key "{api_key}" and model "{model_id}"')
def step_create_google_provider(context, api_key, model_id):
patcher = patch("cleveragents.providers.llm.google_provider.ChatGoogleGenerativeAI")
context.chat_google_patcher = patcher
@@ -156,9 +154,13 @@ def step_stream_plan_generation(context):
'the Google provider should construct ChatGoogleGenerativeAI with api key "{api_key}" and model "{model_id}"'
)
def step_assert_chat_google_constructor(context, api_key, model_id):
assert context.chat_google_call is not None, "ChatGoogleGenerativeAI should have been called"
assert context.chat_google_call is not None, (
"ChatGoogleGenerativeAI should have been called"
)
call_args, call_kwargs = context.chat_google_call
assert call_args == (), "ChatGoogleGenerativeAI should be called with keyword arguments"
assert call_args == (), (
"ChatGoogleGenerativeAI should be called with keyword arguments"
)
assert call_kwargs["api_key"] == api_key
assert call_kwargs["model"] == model_id
@@ -173,7 +175,9 @@ def step_assert_chat_google_constructor(context, api_key, model_id):
'the Google provider should include kwargs "{kwargs_string}" in the ChatGoogleGenerativeAI call'
)
def step_assert_chat_google_kwargs(context, kwargs_string):
assert context.chat_google_call is not None, "ChatGoogleGenerativeAI should have been called"
assert context.chat_google_call is not None, (
"ChatGoogleGenerativeAI should have been called"
)
_, call_kwargs = context.chat_google_call
expected_kwargs = _parse_kwargs_string(kwargs_string)
for key, value in expected_kwargs.items():
@@ -265,4 +269,6 @@ def step_assert_google_provider_error(context, message):
def step_assert_google_supports_streaming(context):
provider = getattr(context, "provider", None)
assert provider is not None, "Provider should exist"
assert provider._supports_streaming is True, "Google provider should support streaming"
assert provider._supports_streaming is True, (
"Google provider should support streaming"
)