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:
Abhishek 2026-05-04 21:35:37 +05:30 committed by GitHub
parent d256c6005c
commit 0e12c41fc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 1776 additions and 670 deletions

View file

@ -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