From 3880a4ec4971d73c91c0ecfbd8e4e59d5795d784 Mon Sep 17 00:00:00 2001 From: Francwa Date: Sat, 27 Dec 2025 19:41:22 +0100 Subject: [PATCH] chore: ran linter and formatter --- alfred/agent/prompts.py | 2 +- tests/test_prompts_critical.py | 6 +++--- tests/test_registry_critical.py | 18 +++++++++--------- tests/test_registry_edge_cases.py | 12 ++++++------ tests/test_repositories.py | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/alfred/agent/prompts.py b/alfred/agent/prompts.py index f43bc85..d568b9d 100644 --- a/alfred/agent/prompts.py +++ b/alfred/agent/prompts.py @@ -52,7 +52,7 @@ class PromptBuilder: # Show first 5 results for i, result in enumerate(result_list[:5]): name = result.get("name", "Unknown") - lines.append(f" {i+1}. {name}") + lines.append(f" {i + 1}. {name}") if len(result_list) > 5: lines.append(f" ... and {len(result_list) - 5} more") diff --git a/tests/test_prompts_critical.py b/tests/test_prompts_critical.py index 499514e..bd34041 100644 --- a/tests/test_prompts_critical.py +++ b/tests/test_prompts_critical.py @@ -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.""" diff --git a/tests/test_registry_critical.py b/tests/test_registry_critical.py index 5f8a2c2..7143849 100644 --- a/tests/test_registry_critical.py +++ b/tests/test_registry_critical.py @@ -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.""" diff --git a/tests/test_registry_edge_cases.py b/tests/test_registry_edge_cases.py index 16a761b..10b45f7 100644 --- a/tests/test_registry_edge_cases.py +++ b/tests/test_registry_edge_cases.py @@ -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.""" diff --git a/tests/test_repositories.py b/tests/test_repositories.py index c6e9993..a323d60 100644 --- a/tests/test_repositories.py +++ b/tests/test_repositories.py @@ -226,13 +226,13 @@ class TestJsonTVShowRepository: [ShowStatus.ONGOING, ShowStatus.ENDED, ShowStatus.UNKNOWN] ): show = TVShow( - imdb_id=ImdbId(f"tt{i+1000000:07d}"), + imdb_id=ImdbId(f"tt{i + 1000000:07d}"), title=f"Show {status.value}", seasons_count=1, status=status, ) repo.save(show) - loaded = repo.find_by_imdb_id(ImdbId(f"tt{i+1000000:07d}")) + loaded = repo.find_by_imdb_id(ImdbId(f"tt{i + 1000000:07d}")) assert loaded.status == status