chore: ran linter and formatter

This commit is contained in:
2025-12-27 19:41:22 +01:00
parent 6195abbaa5
commit 3880a4ec49
5 changed files with 21 additions and 21 deletions

View File

@@ -15,9 +15,9 @@ class TestPromptBuilderToolsInjection:
# Verify each tool is mentioned
for tool_name in tools.keys():
assert (
tool_name in prompt
), f"Tool {tool_name} not mentioned in system prompt"
assert tool_name in prompt, (
f"Tool {tool_name} not mentioned in system prompt"
)
def test_tools_spec_contains_all_registered_tools(self, memory):
"""CRITICAL: Verify build_tools_spec() returns all tools."""

View File

@@ -22,9 +22,9 @@ class TestToolSpecFormat:
for spec in specs:
# OpenAI format requires these fields
assert (
spec["type"] == "function"
), f"Tool type must be 'function', got {spec.get('type')}"
assert spec["type"] == "function", (
f"Tool type must be 'function', got {spec.get('type')}"
)
assert "function" in spec, "Tool spec missing 'function' key"
func = spec["function"]
@@ -55,9 +55,9 @@ class TestToolSpecFormat:
# Verify required vs optional
assert "name" in tool.parameters["required"], "name should be required"
assert "age" in tool.parameters["required"], "age should be required"
assert (
"active" not in tool.parameters["required"]
), "active has default, should not be required"
assert "active" not in tool.parameters["required"], (
"active has default, should not be required"
)
def test_all_registered_tools_are_callable(self):
"""CRITICAL: Verify all registered tools are actually callable."""
@@ -127,9 +127,9 @@ class TestToolSpecFormat:
properties = params.get("properties", {})
for param_name, param_spec in properties.items():
assert (
"description" in param_spec
), f"Parameter {param_name} in {spec['function']['name']} missing description"
assert "description" in param_spec, (
f"Parameter {param_name} in {spec['function']['name']} missing description"
)
def test_required_parameters_are_marked_correctly(self):
"""Verify required parameters are correctly identified."""

View File

@@ -181,9 +181,9 @@ class TestMakeToolsEdgeCases:
params = tool.parameters
if "required" in params and "properties" in params:
for req in params["required"]:
assert (
req in params["properties"]
), f"Required param {req} not in properties for {tool.name}"
assert req in params["properties"], (
f"Required param {req} not in properties for {tool.name}"
)
def test_make_tools_descriptions_not_empty(self, memory):
"""Should have non-empty descriptions."""
@@ -234,9 +234,9 @@ class TestMakeToolsEdgeCases:
if "properties" in tool.parameters:
for prop_name, prop_schema in tool.parameters["properties"].items():
if "type" in prop_schema:
assert (
prop_schema["type"] in valid_types
), f"Invalid type for {tool.name}.{prop_name}"
assert prop_schema["type"] in valid_types, (
f"Invalid type for {tool.name}.{prop_name}"
)
def test_make_tools_enum_values(self, memory):
"""Should have valid enum values."""