2 changed files with 39 additions and 0 deletions
@ -0,0 +1,13 @@
|
||||
from voice_transcriptor.models import AppSettings, MediaInfo |
||||
|
||||
|
||||
class TranscriptionNotImplementedError(RuntimeError): |
||||
"""Raised because transcription is outside the milestone 1 scope.""" |
||||
|
||||
|
||||
class TranscriptionService: |
||||
def transcribe(self, media: MediaInfo, settings: AppSettings) -> None: |
||||
del media, settings |
||||
raise TranscriptionNotImplementedError( |
||||
"Transcription is not implemented in milestone 1." |
||||
) |
||||
@ -0,0 +1,26 @@
|
||||
from pathlib import Path |
||||
|
||||
import pytest |
||||
|
||||
from voice_transcriptor.models import AppSettings, MediaInfo |
||||
from voice_transcriptor.services.transcription import ( |
||||
TranscriptionNotImplementedError, |
||||
TranscriptionService, |
||||
) |
||||
|
||||
|
||||
def test_transcribe_raises_milestone_exception_with_user_readable_message() -> None: |
||||
media = MediaInfo( |
||||
path=Path("sample.mp3"), |
||||
size_bytes=1, |
||||
duration_seconds=1.0, |
||||
audio_codec="mp3", |
||||
) |
||||
settings = AppSettings( |
||||
model="gpt-4o-mini-transcribe", |
||||
language="en", |
||||
output_directory=Path("output"), |
||||
) |
||||
|
||||
with pytest.raises(TranscriptionNotImplementedError, match="(?i)not implemented"): |
||||
TranscriptionService().transcribe(media, settings) |
||||
Loading…
Reference in new issue