a2a-source-edit: write tests/test_full_stack_contract.py
This commit is contained in:
@@ -36,6 +36,8 @@ def test_full_stack_product_contract():
|
||||
card = load_local_project(ROOT).agent_cls().card()
|
||||
skill_names = {skill.name for skill in card.skills}
|
||||
assert {"audit_url", "get_audit"}.issubset(skill_names)
|
||||
audit_schema = next(skill.input_schema for skill in card.skills if skill.name == "audit_url")
|
||||
assert set(audit_schema["properties"]) == {"audit_id", "url"}
|
||||
databases = card.runtime.platform_resources.databases
|
||||
assert databases, "live Agent Card must declare its managed database"
|
||||
assert databases[0].scope == "user"
|
||||
@@ -100,13 +102,13 @@ async def test_acceptance_success_reload_and_receipt(monkeypatch):
|
||||
result = await app.local_invoke("audit_url", auth=_ctx().auth, audit_id="studio-launch-v1", url="https://example.com")
|
||||
assert result["ok"] is True
|
||||
assert result["audit_id"] == "studio-launch-v1"
|
||||
assert result["target_url"] == "https://example.com/"
|
||||
assert result["target_url"] == "https://example.com"
|
||||
assert result["report"]["reachable"] is True
|
||||
assert result["receipt"]["receipt_id"].startswith("launchcheck:studio-launch-v1:")
|
||||
|
||||
reopened = await app.local_invoke("get_audit", auth=_ctx().auth, audit_id="studio-launch-v1")
|
||||
assert reopened["ok"] is True
|
||||
assert reopened["target_url"] == "https://example.com/"
|
||||
assert reopened["target_url"] == "https://example.com"
|
||||
assert reopened["report"]["reachable"] is True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user