Properly skip a2a tests if fasta2a not installed
This commit is contained in:
parent
afd4a581fb
commit
4cc25407ef
2 changed files with 11 additions and 9 deletions
|
|
@ -2,15 +2,6 @@ import uuid
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from haiku.rag.a2a import (
|
|
||||||
extract_question_from_task,
|
|
||||||
get_agent_skills,
|
|
||||||
load_message_history,
|
|
||||||
save_message_history,
|
|
||||||
)
|
|
||||||
from haiku.rag.a2a.storage import LRUMemoryStorage
|
|
||||||
from haiku.rag.client import HaikuRAG
|
|
||||||
|
|
||||||
pytest.importorskip("fasta2a")
|
pytest.importorskip("fasta2a")
|
||||||
|
|
||||||
from fasta2a.schema import Message, TextPart # noqa: E402
|
from fasta2a.schema import Message, TextPart # noqa: E402
|
||||||
|
|
@ -25,6 +16,15 @@ from pydantic_ai.messages import (
|
||||||
TextPart as AITextPart,
|
TextPart as AITextPart,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from haiku.rag.a2a import (
|
||||||
|
extract_question_from_task,
|
||||||
|
get_agent_skills,
|
||||||
|
load_message_history,
|
||||||
|
save_message_history,
|
||||||
|
)
|
||||||
|
from haiku.rag.a2a.storage import LRUMemoryStorage
|
||||||
|
from haiku.rag.client import HaikuRAG
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_save_and_load_message_history():
|
async def test_save_and_load_message_history():
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,7 @@ async def test_serve_monitor_only(app: HaikuRAGApp, monkeypatch):
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_serve_a2a_only(app: HaikuRAGApp, monkeypatch):
|
async def test_serve_a2a_only(app: HaikuRAGApp, monkeypatch):
|
||||||
"""Test the serve method with A2A server only."""
|
"""Test the serve method with A2A server only."""
|
||||||
|
pytest.importorskip("fasta2a")
|
||||||
created_tasks = []
|
created_tasks = []
|
||||||
original_create_task = asyncio.create_task
|
original_create_task = asyncio.create_task
|
||||||
|
|
||||||
|
|
@ -287,6 +288,7 @@ async def test_serve_a2a_only(app: HaikuRAGApp, monkeypatch):
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_serve_all_services(app: HaikuRAGApp, monkeypatch):
|
async def test_serve_all_services(app: HaikuRAGApp, monkeypatch):
|
||||||
"""Test the serve method with all services enabled."""
|
"""Test the serve method with all services enabled."""
|
||||||
|
pytest.importorskip("fasta2a")
|
||||||
created_tasks = []
|
created_tasks = []
|
||||||
original_create_task = asyncio.create_task
|
original_create_task = asyncio.create_task
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue