server: implement audio waveform download as json

Closes #136
This commit is contained in:
2023-08-23 12:32:43 +02:00
committed by Mathieu Virbel
parent 196aa8454f
commit c21d88b797
3 changed files with 142 additions and 2 deletions

View File

@@ -93,3 +93,15 @@ async def test_transcript_audio_download_range_with_seek(
assert response.status_code == 206
assert response.headers["content-type"] == content_type
assert response.headers["content-range"].startswith("bytes 100-")
@pytest.mark.asyncio
async def test_transcript_audio_download_waveform(fake_transcript):
from reflector.app import app
ac = AsyncClient(app=app, base_url="http://test/v1")
response = await ac.get(f"/transcripts/{fake_transcript.id}/audio/waveform")
assert response.status_code == 200
assert response.headers["content-type"] == "application/json"
assert isinstance(response.json()["data"], list)
assert len(response.json()["data"]) == 1000