35 lines
887 B
Python
35 lines
887 B
Python
|
|
from fastapi.testclient import TestClient
|
|
|
|
from voice_assistant.audio_gateway.app.main import app
|
|
|
|
|
|
client = TestClient(app)
|
|
|
|
|
|
def test_web_client_page():
|
|
response = client.get("/ui")
|
|
|
|
assert response.status_code == 200
|
|
assert "Oracle — assistente de voz" in response.text
|
|
assert 'id="microphone"' in response.text
|
|
assert 'id="feedback"' in response.text
|
|
assert "assistantIntegration" in response.text
|
|
|
|
|
|
def test_web_client_javascript():
|
|
response = client.get("/web/app.js")
|
|
|
|
assert response.status_code == 200
|
|
assert "audio.start" in response.text
|
|
assert "audio.stop" in response.text
|
|
assert "agent.delta" in response.text
|
|
|
|
|
|
def test_web_client_audio_worklet():
|
|
response = client.get("/web/pcm-worklet.js")
|
|
|
|
assert response.status_code == 200
|
|
assert "registerProcessor" in response.text
|
|
assert "pcm-input" in response.text
|