fix: Chat und Stimmen-Seite nennen den Grund für eine leere Stimmenliste; Version 0.1.15-rc10
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GmHhg6k5Hxh8GpVW7od4Di
This commit is contained in:
@ -191,6 +191,10 @@ impl Engine for StudioEngine {
|
||||
}
|
||||
}
|
||||
|
||||
async fn voices_reachable(&self) -> bool {
|
||||
self.reachable(Duration::from_secs(3)).await
|
||||
}
|
||||
|
||||
async fn voices(&self) -> Vec<crate::types::Voice> {
|
||||
let get = |path: &'static str| {
|
||||
let url = format!("{}{path}", self.base());
|
||||
@ -292,6 +296,17 @@ impl Engine for StudioEngine {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[tokio::test]
|
||||
async fn studio_aus_ist_nicht_erreichbar_und_ohne_stimmen() {
|
||||
// Port 9 (discard) ist lokal geschlossen: Die Liste ist leer und „nicht erreichbar“ wird gemeldet.
|
||||
let engine = StudioEngine::new(StudioConfig {
|
||||
base_url: "http://127.0.0.1:9".to_string(),
|
||||
..StudioConfig::default()
|
||||
});
|
||||
assert!(!engine.voices_reachable().await);
|
||||
assert!(engine.voices().await.is_empty());
|
||||
}
|
||||
|
||||
use super::*;
|
||||
use std::path::PathBuf;
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
||||
Reference in New Issue
Block a user