Files
transcription/tests/test_config.py
T

34 lines
1.1 KiB
Python

"""Tests for transcription.config — settings loading, provider defaults, and paths."""
from transcription.config import Provider, Settings
class TestSettingsLoading:
"""Verify Settings construction and required-field validation."""
def test_loads_from_env(self):
"""Settings constructs when OPENROUTER_API_KEY is provided."""
def test_requires_api_key(self):
"""Settings raises ValidationError when OPENROUTER_API_KEY is missing."""
class TestProviderSettings:
"""Verify provider enum defaults and validation."""
def test_defaults_to_openrouter(self):
"""Default provider is openrouter when not explicitly set."""
def test_rejects_invalid_value(self):
"""Setting PROVIDER to an invalid value raises ValidationError."""
def test_optional_fields_default_to_none(self):
"""provider_model, openrouter_http_referer, and openrouter_app_title are None when unset."""
class TestPathSettings:
"""Verify filesystem path field types."""
def test_path_fields_are_path_objects(self):
"""upload_dir and prompt_dir are Path instances."""