Test adjustment

This commit is contained in:
Raivis Dejus 2025-06-24 19:54:18 +03:00
commit adea64d759

View file

@ -1,5 +1,6 @@
from typing import List
from unittest.mock import Mock
from pathlib import Path
import pytest
from pytestqt.qtbot import QtBot
@ -17,6 +18,7 @@ from tests.audio import test_audio_path, test_multibyte_utf8_audio_path
from tests.model_loader import get_model_path
# TODO Add test for CPU mode (BUZZ_FORCE_CPU=true)
class TestWhisperCppFileTranscriber:
@pytest.mark.parametrize(
"word_level_timings,expected_segments",
@ -32,7 +34,7 @@ class TestWhisperCppFileTranscriber:
self, qtbot: QtBot, word_level_timings: bool, expected_segments: List[Segment]
):
file_transcription_options = FileTranscriptionOptions(
file_paths=[test_audio_path]
file_paths=[str(Path(test_audio_path).resolve())]
)
transcription_options = TranscriptionOptions(
language="fr",
@ -47,7 +49,7 @@ class TestWhisperCppFileTranscriber:
model_path = get_model_path(transcription_options.model)
transcriber = WhisperCppFileTranscriber(
task=FileTranscriptionTask(
file_path=test_audio_path,
file_path=str(Path(test_audio_path).resolve()),
transcription_options=transcription_options,
file_transcription_options=file_transcription_options,
model_path=model_path,
@ -92,7 +94,7 @@ class TestWhisperCppFileTranscriber:
self, qtbot: QtBot, word_level_timings: bool, expected_segments: List[Segment]
):
file_transcription_options = FileTranscriptionOptions(
file_paths=[test_multibyte_utf8_audio_path]
file_paths=[str(Path(test_multibyte_utf8_audio_path).resolve())]
)
transcription_options = TranscriptionOptions(
language="lv",
@ -107,7 +109,7 @@ class TestWhisperCppFileTranscriber:
model_path = get_model_path(transcription_options.model)
transcriber = WhisperCppFileTranscriber(
task=FileTranscriptionTask(
file_path=test_multibyte_utf8_audio_path,
file_path=str(Path(test_multibyte_utf8_audio_path).resolve()),
transcription_options=transcription_options,
file_transcription_options=file_transcription_options,
model_path=model_path,