decomposer: generate deliverable files for Inspect the single_agent template and target repository conventions to identify the required project structure, configuration, interfaces, and implementation patterns for the application landing zone agent.; Define the application landing zone agent's behavior, input and output contracts, document-generation workflow, and architecture-diagram requirements using the extracted template conventions.; Validate the implemented application_landing_zone_agent by running repository tests and checking the TSD document generation, draw.io diagram generation, agent packaging, configuration, and committed implementation against the defined contracts.; Commit and push the validated application_landing_zone_agent implementation to the target repository.
This commit is contained in:
30
tests/test_agent.py
Normal file
30
tests/test_agent.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import json, unittest
|
||||
import xml.etree.ElementTree as ET
|
||||
from pathlib import Path
|
||||
from application_landing_zone_agent import LandingZoneAgent, ValidationError
|
||||
|
||||
class AgentContractTests(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.data = json.loads(Path("examples/application.json").read_text())
|
||||
cls.agent = LandingZoneAgent()
|
||||
def test_generation_is_deterministic_and_complete(self):
|
||||
a, b = self.agent.generate(self.data), self.agent.generate(self.data)
|
||||
self.assertEqual(a, b)
|
||||
self.assertIn("## Component inventory", a.tsd_markdown)
|
||||
self.assertIn("Orders API", a.tsd_markdown)
|
||||
self.assertTrue(a.validation.valid)
|
||||
def test_drawio_is_native_xml_with_vertices_and_edges(self):
|
||||
root = ET.fromstring(self.agent.generate(self.data).drawio_xml)
|
||||
self.assertEqual(root.tag, "mxfile")
|
||||
self.assertIsNotNone(root.find(".//mxGraphModel"))
|
||||
self.assertGreaterEqual(len(root.findall(".//mxCell[@vertex='1']")), 4)
|
||||
self.assertGreaterEqual(len(root.findall(".//mxCell[@edge='1']")), 1)
|
||||
def test_required_input_errors(self):
|
||||
with self.assertRaises(ValidationError): self.agent.generate({"application_name": "x"})
|
||||
def test_cli_fixture_has_expected_contract(self):
|
||||
report = self.agent.validate(self.data)
|
||||
self.assertFalse(report.errors)
|
||||
self.assertEqual(report.warnings, [])
|
||||
|
||||
if __name__ == "__main__": unittest.main()
|
||||
Reference in New Issue
Block a user