generated from john/python-template
model used being carried thru
This commit is contained in:
@@ -5,7 +5,8 @@ from pathlib import Path
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
||||
from transcription.config import Provider, Settings
|
||||
from transcription.config import Provider
|
||||
from transcription.config import Settings
|
||||
|
||||
|
||||
def _make_settings(**overrides) -> Settings:
|
||||
@@ -19,14 +20,14 @@ class TestSettingsLoading:
|
||||
"""Verify Settings construction and required-field validation."""
|
||||
|
||||
def test_loads_from_env(self, monkeypatch):
|
||||
"""Settings constructs when OPENROUTER_API_KEY is provided."""
|
||||
monkeypatch.setenv("OPENROUTER_API_KEY", "test-key-xyz")
|
||||
"""Settings constructs when TRANSCRIPTION_OPENROUTER_API_KEY is provided."""
|
||||
monkeypatch.setenv("TRANSCRIPTION_OPENROUTER_API_KEY", "test-key-xyz")
|
||||
settings = Settings()
|
||||
assert settings.openrouter_api_key == "test-key-xyz"
|
||||
|
||||
def test_requires_api_key(self, monkeypatch):
|
||||
"""Settings raises ValidationError when OPENROUTER_API_KEY is missing."""
|
||||
monkeypatch.delenv("OPENROUTER_API_KEY", raising=False)
|
||||
"""Settings raises ValidationError when required provider API key is missing."""
|
||||
monkeypatch.delenv("TRANSCRIPTION_OPENROUTER_API_KEY", raising=False)
|
||||
with pytest.raises(ValidationError):
|
||||
Settings(_env_file=None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user