feat: initialize agents from a2a template
All checks were successful
build / build (push) Successful in 2s
All checks were successful
build / build (push) Successful in 2s
This commit is contained in:
27
tests/test_template_init.py
Normal file
27
tests/test_template_init.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
|
||||
from agent_builder.tools import _render_a2a_init_template
|
||||
|
||||
|
||||
class TemplateInitTests(unittest.TestCase):
|
||||
def test_render_a2a_init_template_matches_sdk_starter(self) -> None:
|
||||
files = _render_a2a_init_template(
|
||||
"research-agent",
|
||||
description="Research helper",
|
||||
)
|
||||
|
||||
self.assertEqual(set(files), {"agent.py", "a2a.yaml", "requirements.txt"})
|
||||
self.assertIn('name = "research-agent"', files["agent.py"])
|
||||
self.assertIn('description = "Research helper"', files["agent.py"])
|
||||
self.assertIn("LLMProvisioning.CALLER_PROVIDED", files["agent.py"])
|
||||
self.assertIn("ctx.llm", files["agent.py"])
|
||||
self.assertIn("create_deep_agent", files["agent.py"])
|
||||
self.assertIn("name: research-agent", files["a2a.yaml"])
|
||||
self.assertIn("entrypoint: agent:ResearchAgent", files["a2a.yaml"])
|
||||
self.assertIn("deepagents>=0.5.0", files["requirements.txt"])
|
||||
|
||||
def test_render_a2a_init_template_rejects_invalid_names(self) -> None:
|
||||
with self.assertRaises(ValueError):
|
||||
_render_a2a_init_template("Bad Name")
|
||||
Reference in New Issue
Block a user