Files
lai_automatisierung/tests/test_agent.py
Christian Meyer 1344c906b7
Some checks failed
CI / test (push) Has been cancelled
CI / test (pull_request) Has been cancelled
fix: focus failure-report agent scope
2026-08-31 03:07:29 +02:00

30 lines
1017 B
Python

from __future__ import annotations
from lai_automation.agent import _SYSTEM_TEMPLATE, MiniSWEAgentRunner
from lai_automation.models import Issue
def test_task_uses_issue_text_not_github_parser() -> None:
issue = Issue(
number=42,
title="Wrong result",
body="Original prompt and expected result",
html_url="https://gitea.example.test/owner/lai/issues/42",
labels=(),
)
task = MiniSWEAgentRunner._task(issue)
assert "Issue #42: Wrong result" in task
assert issue.html_url in task
assert issue.body in task
def test_system_prompt_requires_precise_diff_hygiene() -> None:
assert "Never create backup files" in _SYSTEM_TEMPLATE
assert "failure-report transport code" in _SYSTEM_TEMPLATE
assert "Preserve unrelated lines exactly" in _SYSTEM_TEMPLATE
assert "closest existing test class" in _SYSTEM_TEMPLATE
assert "inspect all key columns and cardinality" in _SYSTEM_TEMPLATE
assert "remove trailing spaces" in _SYSTEM_TEMPLATE