Items completed: 1. Merged PR #2 (starlette/httpx deps) 2. Fixed async race condition in multimodal_ui.py 3. Wired TTSAdapter (ElevenLabs, Azure) in API routes 4. Moved super_big_brain.py from core/ to reasoning/ (backward compat shim) 5. Added API authentication middleware (Bearer token via FUSIONAGI_API_KEY) 6. Added async adapter interface (acomplete/acomplete_structured) 7. Migrated FastAPI on_event to lifespan (fixes 20 deprecation warnings) 8. Liquid Neural Networks (continuous-time adaptive weights) 9. Quantum-AI Hybrid compute backend (simulator + optimization) 10. Embodied Intelligence / Robotics bridge (actuator + sensor protocols) 11. Consciousness Engineering (formal self-model with introspection) 12. ASI Scoring Rubric (C/A/L/N/R self-assessment harness) 13. GPU integration tests for TensorFlow backend 14. Multi-stage production Dockerfile 15. Gitea CI/CD pipeline (lint, test matrix, Docker build) 16. API rate limiting middleware (per-IP sliding window) 17. OpenAPI docs cleanup (auth + rate limiting descriptions) 18. Benchmarking suite (decomposition, multi-path, recomposition, e2e) 19. Plugin system (head registry for custom heads) 427 tests passing, 0 ruff errors, 0 mypy errors. Co-Authored-By: Nakamoto, S <defi@defi-oracle.io>
32 lines
878 B
Python
32 lines
878 B
Python
"""Tests for TTS adapter module."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from fusionagi.adapters.tts_adapter import StubTTSAdapter, audio_to_base64
|
|
|
|
|
|
class TestStubTTSAdapter:
|
|
@pytest.mark.asyncio
|
|
async def test_synthesize_returns_bytes(self) -> None:
|
|
adapter = StubTTSAdapter()
|
|
result = await adapter.synthesize("Hello world")
|
|
assert result == b""
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_synthesize_with_voice_id(self) -> None:
|
|
adapter = StubTTSAdapter()
|
|
result = await adapter.synthesize("Test", voice_id="test_voice")
|
|
assert result is not None
|
|
|
|
|
|
class TestAudioToBase64:
|
|
def test_encodes_bytes(self) -> None:
|
|
result = audio_to_base64(b"hello")
|
|
assert result == "aGVsbG8="
|
|
|
|
def test_empty_bytes(self) -> None:
|
|
result = audio_to_base64(b"")
|
|
assert result == ""
|