KeiSeiKit-1.0/_primitives/_rust/kei-llm-ollama/tests/health_running.rs
Parfii-bot 0be354a920 KeiSeiKit-public — clean state
Single-commit clean baseline after security scrub of niche-tells,
project codenames, internal jargon, and contributor-email leaks.

Contents:
- 100 Rust crates (_primitives/_rust/)
- 37 agent manifests (_manifests/) + generated specs (_generated/)
- 67 user-invocable skills (skills/)
- 33 hooks (hooks/)
- Composition blocks (_blocks/)
- Documentation (docs/, README.md)
- TS adapter packages (_ts_packages/)
- Assembler (_assembler/)
- Roles (_roles/)
- Templates (_templates/)
- Forgejo CI (.forgejo/)

Author: Denis Parfionovich <info@greendragon.info>

License: see LICENSE.
2026-05-01 12:09:03 +08:00

28 lines
1,020 B
Rust

//! `is_running` returns `true` when /api/tags responds 200.
use kei_llm_ollama::{is_running, snapshot, Client};
use wiremock::matchers::{method, path};
use wiremock::{Mock, MockServer, ResponseTemplate};
#[tokio::test]
async fn is_running_returns_true_for_live_daemon() {
let server = MockServer::start().await;
Mock::given(method("GET"))
.and(path("/api/tags"))
.respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({"models": []})))
.mount(&server)
.await;
Mock::given(method("GET"))
.and(path("/api/version"))
.respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({"version": "0.21.2"})))
.mount(&server)
.await;
let client = Client::new(server.uri());
assert!(is_running(&client).await, "expected is_running == true");
let snap = snapshot(&client).await;
assert!(snap.running);
assert_eq!(snap.version.as_deref(), Some("0.21.2"));
assert_eq!(snap.models_count, Some(0));
}