Download tests/test_task_package.py from smlflg/meine-linux-app: direct link, hf CLI and curl.
- Browser
- Download file 2.62 kB
-
https://huggingface.co/smlflg/meine-linux-app/resolve/main/tests/test_task_package.py
- Command line
-
hf download hf://smlflg/meine-linux-app/tests/test_task_package.py
-
curl -L -o test_task_package.py https://huggingface.co/smlflg/meine-linux-app/resolve/main/tests/test_task_package.py
2.62 kB
| from pathlib import Path | |
| import pytest | |
| from meine_app.package import InputPackageDraft, freitext_sections | |
| from meine_app.task_package import ( | |
| build_ir_task_package_markdown, | |
| next_ir_id, | |
| write_ir_task_package, | |
| ) | |
| def test_next_ir_id_from_queue(tmp_path: Path): | |
| (tmp_path / "IR-2026-0070-task-package.md").write_text("x", encoding="utf-8") | |
| seq = tmp_path / "ir_seq.json" | |
| assert next_ir_id(seq_path=seq, queue_dir=tmp_path) == "IR-2026-0071" | |
| def test_build_ir_task_package_requires_profile(tmp_path: Path): | |
| pkg_dir = tmp_path / "packets" / "demo__pkg-20260101-120000" | |
| pkg_dir.mkdir(parents=True) | |
| with pytest.raises(ValueError, match="Zielagent"): | |
| build_ir_task_package_markdown( | |
| InputPackageDraft(name="Demo", text_sections=freitext_sections("x")), | |
| ir_id="IR-2026-0099", | |
| packet_path=pkg_dir, | |
| ) | |
| def test_build_ir_task_package_has_required_sections(tmp_path: Path): | |
| project = tmp_path / "meine-linux-app" | |
| project.mkdir() | |
| pkg_dir = tmp_path / "packets" / "demo__pkg-20260101-120000" | |
| pkg_dir.mkdir(parents=True) | |
| md = build_ir_task_package_markdown( | |
| InputPackageDraft( | |
| name="Auth Fix", | |
| project_path=str(project), | |
| session_brief="Nur Login-Flow", | |
| harness="opencode", | |
| profile="hai-agent", | |
| ), | |
| ir_id="IR-2026-0099", | |
| packet_path=pkg_dir, | |
| ) | |
| assert "## Aufgabe" in md | |
| assert "## Kontext" in md | |
| assert "- Quelle: hai-intake" in md | |
| assert "## Grenzen" in md | |
| assert "## Zielagent" in md | |
| assert "`hai-agent`" in md | |
| assert "## Definition of Done für Zielagent" in md | |
| assert "Harness (Runtime): opencode" in md | |
| assert "project_id: meine-linux-app" in md | |
| def test_write_ir_task_package_creates_file(tmp_path: Path): | |
| project = tmp_path / "DemoProjekt" | |
| project.mkdir() | |
| pkg_dir = tmp_path / "packets" / "demo__pkg-20260101-120000" | |
| pkg_dir.mkdir(parents=True) | |
| queue = tmp_path / "intake_queue" | |
| seq = tmp_path / "ir_seq.json" | |
| ir_id, task_path = write_ir_task_package( | |
| InputPackageDraft( | |
| name="Demo", | |
| project_path=str(project), | |
| session_brief="Scope klein", | |
| text_sections=freitext_sections("Kontext"), | |
| profile="uniagent", | |
| ), | |
| pkg_dir, | |
| seq_path=seq, | |
| queue_dir=queue, | |
| ) | |
| assert task_path.is_file() | |
| assert ir_id == "IR-2026-0001" | |
| content = task_path.read_text(encoding="utf-8") | |
| assert "## Zielagent" in content | |
| assert "`uniagent`" in content | |