اختبار المهارات
اختبار المهارات
Section titled “اختبار المهارات”فضّل pytest على دوال أدواتك، والتحقق من المركز (hub) على مسار الحزمة.
مهارة الأدوات الأصلية
Section titled “مهارة الأدوات الأصلية”my_skill/ skill_manifest.yaml tools.py tests/ test_tools.pyimport pytestfrom tools import example_echo # or import path under kazma_skills.native…
@pytest.mark.asyncioasync def test_example_echo(): out = await example_echo(message="Hello") assert "Hello" in outالتحقق من حزمة المركز
Section titled “التحقق من حزمة المركز”kazma hub validate ./my_skillkazma hub check-certification ./my_skillاختبار وحدة للبيان:
import yamlfrom 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")الخطر / HITL
Section titled “الخطر / HITL”إذا كانت الأداة على قائمة الخطر، فينبغي لاختبارات التكامل أحد أمرين:
- محاكاة ناقل الأمان (mock)، أو
- تمرير مسار الموافقة في الرسم البياني (graph) ضمن تركيبات اختبار مضبوطة فقط
لا تعطّل HITL في الاختبارات الشبيهة بالإنتاج دون علامة خروج صريحة (escape hatch).