تخطَّ إلى المحتوى
kazma.
EN نجمة 6 ابدأ الآن

اختبار المهارات

فضّل pytest على دوال أدواتك، والتحقق من المركز (hub) على مسار الحزمة.

my_skill/
skill_manifest.yaml
tools.py
tests/
test_tools.py
tests/test_tools.py
import pytest
from tools import example_echo # or import path under kazma_skills.native…
@pytest.mark.asyncio
async def test_example_echo():
out = await example_echo(message="Hello")
assert "Hello" in out
Terminal window
kazma hub validate ./my_skill
kazma hub check-certification ./my_skill

اختبار وحدة للبيان:

import yaml
from pathlib import Path
def test_manifest_loads():
data = yaml.safe_load(Path("skill_manifest.yaml").read_text(encoding="utf-8"))
assert data.get("name")
assert "tools" in data or data.get("entry_point")

إذا كانت الأداة على قائمة الخطر، فينبغي لاختبارات التكامل أحد أمرين:

  • محاكاة ناقل الأمان (mock)، أو
  • تمرير مسار الموافقة في الرسم البياني (graph) ضمن تركيبات اختبار مضبوطة فقط

لا تعطّل HITL في الاختبارات الشبيهة بالإنتاج دون علامة خروج صريحة (escape hatch).