mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-05 02:45:28 +00:00
Some checks failed
CI / Focused test guidance (report-only) (push) Has been cancelled
CI / Python syntax (compileall) (push) Has been cancelled
CI / JS syntax (node --check) (push) Has been cancelled
CI / Python tests (pytest) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Container scan / hadolint (Dockerfile lint) (push) Has been cancelled
Container scan (Trivy) / Trivy (image scan, advisory) (push) Has been cancelled
Container scan (Trivy) / Trivy (image scan + SARIF upload) (push) Has been cancelled
Dependency review / dependency-review (PR gate) (push) Has been cancelled
Dependency review / pip-audit (advisory) (push) Has been cancelled
ci / docker publish / build (amd64) (push) Has been cancelled
ci / docker publish / build (arm64) (push) Has been cancelled
Secret scan / gitleaks (push) Has been cancelled
Workflow security / actionlint (push) Has been cancelled
Workflow security / zizmor (Actions SAST) (push) Has been cancelled
ci / docker publish / merge manifest + tag (push) Has been cancelled
17 lines
669 B
Python
17 lines
669 B
Python
from services.tts.tts_service import TTSService
|
|
|
|
|
|
def test_available_tolerates_non_string_provider(tmp_path):
|
|
"""A hand-edited/corrupt data/settings.json can store a non-string
|
|
tts_provider (e.g. null or a number). available reads it and calls
|
|
provider.startswith("endpoint:"), which raised AttributeError on a
|
|
non-str. It must instead fall through and report unavailable."""
|
|
service = TTSService(cache_dir=str(tmp_path))
|
|
service._load_settings = lambda: {
|
|
"tts_enabled": True,
|
|
"tts_provider": 123,
|
|
"tts_model": "tts-1",
|
|
"tts_voice": "alloy",
|
|
"tts_speed": "1",
|
|
}
|
|
assert service.available is False
|