Fix failing tests for agent framework updates
Updated test fixtures and expectations to match new agent naming: - Fixed test registry to use correct agent names (setupRepository, keepaTodofile, keepaChangelog) - Updated test assertions to expect new agent names instead of old ones - Added missing category fields to test agent definitions - Enhanced test registry with keepaChangelog agent for complete template testing All 24 tests now pass: - test_core.py: 6 tests ✅ - test_installer.py: 10 tests ✅ - test_registry.py: 8 tests ✅ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ def test_registry(tmp_path):
|
||||
base_agent = """---
|
||||
name: base-agent
|
||||
description: Base test agent
|
||||
category: testing
|
||||
---
|
||||
|
||||
# Base Agent
|
||||
@@ -25,8 +26,9 @@ This is a base agent for testing.
|
||||
"""
|
||||
|
||||
setup_agent = """---
|
||||
name: setup-repository
|
||||
name: setupRepository
|
||||
description: Repository setup agent
|
||||
category: infrastructure
|
||||
---
|
||||
|
||||
# Setup Repository
|
||||
@@ -35,18 +37,31 @@ Sets up repository structure.
|
||||
"""
|
||||
|
||||
todo_agent = """---
|
||||
name: todo-keeper
|
||||
name: keepaTodofile
|
||||
description: TODO management agent
|
||||
category: project-management
|
||||
---
|
||||
|
||||
# TODO Keeper
|
||||
|
||||
Manages TODO files.
|
||||
"""
|
||||
|
||||
changelog_agent = """---
|
||||
name: keepaChangelog
|
||||
description: Changelog management agent
|
||||
category: project-management
|
||||
---
|
||||
|
||||
# Changelog Keeper
|
||||
|
||||
Manages CHANGELOG files.
|
||||
"""
|
||||
|
||||
(agents_dir / "agent-base-agent.md").write_text(base_agent)
|
||||
(agents_dir / "agent-setup-repository.md").write_text(setup_agent)
|
||||
(agents_dir / "agent-todo-keeper.md").write_text(todo_agent)
|
||||
(agents_dir / "agent-setupRepository.md").write_text(setup_agent)
|
||||
(agents_dir / "agent-keepaTodofile.md").write_text(todo_agent)
|
||||
(agents_dir / "agent-keepaChangelog.md").write_text(changelog_agent)
|
||||
|
||||
return AgentRegistry(agents_dir)
|
||||
|
||||
@@ -80,10 +95,10 @@ def test_install_agents_with_dependencies(test_registry, tmp_path):
|
||||
)
|
||||
|
||||
# Install an agent that depends on others
|
||||
results = installer.install_agents(["setup-repository"], config)
|
||||
results = installer.install_agents(["setupRepository"], config)
|
||||
|
||||
assert "setup-repository" in results
|
||||
assert results["setup-repository"] == "INSTALLED"
|
||||
assert "setupRepository" in results
|
||||
assert results["setupRepository"] == "INSTALLED"
|
||||
|
||||
|
||||
def test_list_installed_agents(test_registry, tmp_path):
|
||||
@@ -97,12 +112,12 @@ def test_list_installed_agents(test_registry, tmp_path):
|
||||
|
||||
# Install some agents
|
||||
config = InstallationConfig(target_dir=project_dir, create_backup=False, update_docs=False)
|
||||
installer.install_agents(["base-agent", "todo-keeper"], config)
|
||||
installer.install_agents(["base-agent", "keepaTodofile"], config)
|
||||
|
||||
# Check installed agents
|
||||
installed = installer.list_installed_agents(project_dir)
|
||||
assert "base-agent" in installed
|
||||
assert "todo-keeper" in installed
|
||||
assert "keepaTodofile" in installed
|
||||
assert len(installed) == 2
|
||||
|
||||
|
||||
@@ -132,7 +147,7 @@ def test_remove_agents(test_registry, tmp_path):
|
||||
|
||||
# Install agents first
|
||||
config = InstallationConfig(target_dir=project_dir, create_backup=False, update_docs=False)
|
||||
installer.install_agents(["base-agent", "todo-keeper"], config)
|
||||
installer.install_agents(["base-agent", "keepaTodofile"], config)
|
||||
|
||||
# Remove an agent
|
||||
results = installer.remove_agents(["base-agent"], project_dir)
|
||||
@@ -220,13 +235,13 @@ def test_project_initializer_custom_agents(test_registry, tmp_path):
|
||||
initializer.init_project(
|
||||
project_dir,
|
||||
template="python-basic",
|
||||
agent_names=["base-agent", "todo-keeper"],
|
||||
agent_names=["base-agent", "keepaTodofile"],
|
||||
project_name="custom_project"
|
||||
)
|
||||
|
||||
# Check that specific agents were installed
|
||||
assert (project_dir / "agents" / "agent-base-agent.md").exists()
|
||||
assert (project_dir / "agents" / "agent-todo-keeper.md").exists()
|
||||
assert (project_dir / "agents" / "agent-keepaTodofile.md").exists()
|
||||
|
||||
|
||||
def test_installation_config():
|
||||
|
||||
@@ -173,8 +173,8 @@ def test_agent_registry_get_templates(tmp_path):
|
||||
assert "comprehensive" in templates
|
||||
|
||||
# Check that templates contain expected agents
|
||||
assert "setup-repository" in templates["python-basic"]
|
||||
assert "todo-keeper" in templates["python-basic"]
|
||||
assert "setupRepository" in templates["python-basic"]
|
||||
assert "keepaTodofile" in templates["python-basic"]
|
||||
|
||||
|
||||
def test_agent_registry_validate_agents(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user