mecha10-behavior-runtime 0.8.0

Behavior tree runtime for Mecha10 - unified AI and logic composition system
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Test helpers for behavior runtime
//!
//! This module provides utilities for testing behaviors without requiring external dependencies.

#[cfg(test)]
use mecha10_core::Context;

/// Create a test context for unit tests that need a `Context` but don't use messaging.
/// For integration tests needing real messaging, use `Context::new()` with proper infrastructure.
#[cfg(test)]
pub async fn create_test_context(node_id: &str) -> Context {
    match Context::new(node_id).await {
        Ok(ctx) => ctx,
        Err(_) => {
            panic!("Test requires Redis - skipping. Run Redis to enable full test suite.");
        }
    }
}