feat: establish voice assistant V1 baseline
This commit is contained in:
31
tests/test_audio_models.py
Normal file
31
tests/test_audio_models.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
Tests for the canonical Voice Assistant audio contract.
|
||||
|
||||
Purpose:
|
||||
Verify that the Voice Core exposes the expected provider-independent
|
||||
canonical audio format.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from voice_assistant.audio.models import (
|
||||
AudioFormat,
|
||||
CANONICAL_AUDIO_FORMAT,
|
||||
)
|
||||
|
||||
|
||||
def test_canonical_audio_format():
|
||||
assert CANONICAL_AUDIO_FORMAT.encoding == "pcm_s16le"
|
||||
assert CANONICAL_AUDIO_FORMAT.sample_rate == 16000
|
||||
assert CANONICAL_AUDIO_FORMAT.channels == 1
|
||||
|
||||
|
||||
def test_audio_format_rejects_unsupported_encoding():
|
||||
with pytest.raises(ValidationError):
|
||||
AudioFormat(
|
||||
encoding="mp3",
|
||||
sample_rate=16000,
|
||||
channels=1,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user