fix: allow custom agent scaffolds
All checks were successful
build / build (push) Successful in 27s

This commit is contained in:
robert
2026-05-17 19:12:58 -03:00
parent 2a6227b8ec
commit 1f3f8349df
3 changed files with 4 additions and 100 deletions

View File

@@ -5,8 +5,6 @@ import tarfile
import unittest
from agent_builder.tools import (
_assert_current_agent_project,
_assert_current_a2a_init_template,
_render_a2a_init_template,
)
@@ -33,21 +31,11 @@ class TemplateInitTests(unittest.TestCase):
with self.assertRaises(ValueError):
_render_a2a_init_template("Bad Name")
def test_stale_sdk_template_is_rejected(self) -> None:
with self.assertRaisesRegex(RuntimeError, "stale"):
_assert_current_a2a_init_template({
"agent.py": "from a2a_pack import A2AAgent",
"requirements.txt": "httpx>=0.27",
})
def test_agent_projects_can_diverge_from_template(self) -> None:
files = _render_a2a_init_template("regex-explainer")
files["agent.py"] = "from a2a_pack import A2AAgent\n"
def test_stale_agent_project_is_rejected(self) -> None:
bundle = _tarball({
"agent.py": "from a2a_pack import A2AAgent\n",
"requirements.txt": "httpx>=0.27\n",
})
with self.assertRaisesRegex(RuntimeError, "agent project is stale"):
_assert_current_agent_project(bundle)
self.assertIn("A2AAgent", files["agent.py"])
def _tarball(files: dict[str, str]) -> bytes: