generated from john/python-template
WIP theming
This commit is contained in:
@@ -7,6 +7,7 @@ from pydantic import ValidationError
|
||||
|
||||
from transcription.config import Provider
|
||||
from transcription.config import Settings
|
||||
from transcription.config import parse_cli_settings
|
||||
|
||||
|
||||
def _make_settings(**overrides) -> Settings:
|
||||
@@ -31,6 +32,30 @@ class TestSettingsLoading:
|
||||
with pytest.raises(ValidationError):
|
||||
Settings(_env_file=None)
|
||||
|
||||
def test_ignores_process_cli_arguments(self, monkeypatch):
|
||||
"""Ordinary settings construction does not consume tooling arguments."""
|
||||
monkeypatch.setattr("sys.argv", ["pytest", "--rootdir=/tmp/project"])
|
||||
|
||||
settings = _make_settings()
|
||||
|
||||
assert settings.port == 8000
|
||||
|
||||
def test_explicit_cli_parser_reads_arguments(self):
|
||||
"""The executable settings boundary accepts application CLI flags."""
|
||||
settings = parse_cli_settings(
|
||||
[
|
||||
"--openrouter-api-key",
|
||||
"test-key",
|
||||
"--port",
|
||||
"8123",
|
||||
"--reload",
|
||||
]
|
||||
)
|
||||
|
||||
assert settings.openrouter_api_key == "test-key"
|
||||
assert settings.port == 8123
|
||||
assert settings.reload is True
|
||||
|
||||
|
||||
class TestProviderSettings:
|
||||
"""Verify provider enum defaults and validation."""
|
||||
|
||||
Reference in New Issue
Block a user