mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-28 08:49:42 +02:00
chore: bump pipecat version and fix tests (#263)
* chore: bump pipecat version and fix tests * chore: add github workflow to run tests * fix: install reqirements.dev.txt in test script * fix: fix api-test action * feat: add integration test * test: add integration tests * test: add test for function call mute strategy
This commit is contained in:
parent
d256c6005c
commit
0e12c41fc7
76 changed files with 1776 additions and 670 deletions
|
|
@ -9,7 +9,7 @@ the root api/conftest.py. This module provides lightweight, non-DB fixtures:
|
|||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Dict, Optional
|
||||
from unittest.mock import Mock
|
||||
from unittest.mock import AsyncMock, Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -123,13 +123,28 @@ class MockToolModel:
|
|||
|
||||
@pytest.fixture
|
||||
def mock_engine():
|
||||
"""Create a mock PipecatEngine."""
|
||||
"""Create a mock PipecatEngine.
|
||||
|
||||
Binds the real `_get_organization_id` method so the fetch + cache logic
|
||||
runs against a patched `db_client.get_organization_id_by_workflow_run_id`
|
||||
(returns org_id=1) for the duration of the fixture.
|
||||
"""
|
||||
from api.services.workflow.pipecat_engine import PipecatEngine
|
||||
|
||||
engine = Mock()
|
||||
engine._workflow_run_id = 1
|
||||
engine._call_context_vars = {"customer_name": "John Doe"}
|
||||
engine._organization_id = None
|
||||
engine._get_organization_id = PipecatEngine._get_organization_id.__get__(engine)
|
||||
engine.llm = Mock()
|
||||
engine.llm.register_function = Mock()
|
||||
return engine
|
||||
|
||||
with patch(
|
||||
"api.db:db_client.get_organization_id_by_workflow_run_id",
|
||||
new_callable=AsyncMock,
|
||||
return_value=1,
|
||||
):
|
||||
yield engine
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue