decomposer: generate files for Create and commit a registry-ready single-agent repository that generates technical solution design documents and draw.io architecture diagrams from application requirements.
This commit is contained in:
30
tests/test_generator.py
Normal file
30
tests/test_generator.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import json
|
||||
|
||||
from application_landing_zone_agent.generator import generate, render_drawio, render_tsd
|
||||
from application_landing_zone_agent.model import normalize
|
||||
|
||||
|
||||
def test_normalize_and_tsd_include_contract_sections():
|
||||
r = normalize({"name": "Orders", "requirements": ["place orders"], "security": ["SSO"], "custom": "kept"})
|
||||
tsd = render_tsd(r)
|
||||
assert "# Technical Solution Design: Orders" in tsd
|
||||
assert "Functional requirements" in tsd
|
||||
assert "SSO" in tsd
|
||||
assert "custom" in tsd
|
||||
|
||||
|
||||
def test_drawio_is_editable_xml_and_escapes_title():
|
||||
xml = render_drawio(normalize({"name": "A & B"}))
|
||||
assert xml.startswith("<?xml")
|
||||
assert "A & B" in xml
|
||||
assert "mxGraphModel" in xml
|
||||
assert 'source="service" target="store"' in xml
|
||||
|
||||
|
||||
def test_generate_writes_artifacts_and_manifest(tmp_path):
|
||||
result = generate({"name": "Payments", "summary": "Secure payments"}, tmp_path)
|
||||
assert result["artifacts"] == ["technical-solution-design.md", "architecture.drawio"]
|
||||
assert (tmp_path / "technical-solution-design.md").exists()
|
||||
assert (tmp_path / "architecture.drawio").read_text().startswith("<?xml")
|
||||
manifest = json.loads((tmp_path / "manifest.json").read_text())
|
||||
assert manifest["sha256"] == result["sha256"]
|
||||
Reference in New Issue
Block a user