31 lines
915 B
Python
31 lines
915 B
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from mka.application.config import AppSettings, ConfigurationError
|
|
|
|
|
|
def test_settings_require_whisper_model() -> None:
|
|
settings = AppSettings(data_root=Path("runs"), whisper_model=None)
|
|
|
|
with pytest.raises(ConfigurationError, match="MKA_WHISPER_MODEL"):
|
|
settings.validate_for_processing()
|
|
|
|
|
|
def test_settings_reject_missing_whisper_model(tmp_path: Path) -> None:
|
|
settings = AppSettings(
|
|
data_root=tmp_path / "runs",
|
|
whisper_model=tmp_path / "missing.bin",
|
|
)
|
|
|
|
with pytest.raises(ConfigurationError, match="does not exist"):
|
|
settings.validate_for_processing()
|
|
|
|
|
|
def test_settings_accept_valid_native_configuration(tmp_path: Path) -> None:
|
|
model = tmp_path / "model.bin"
|
|
model.write_bytes(b"model")
|
|
settings = AppSettings(data_root=tmp_path / "runs", whisper_model=model)
|
|
|
|
settings.validate_for_processing()
|