This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user