Expand description
Testing Utilities - Helper functions for creating test workflows and mock data
This module provides convenient functions to create test workflows, nodes, and analytics data for testing purposes. This is especially useful when writing tests for applications that use oxify-model.
§Example
use oxify_model::test_utils::{create_test_workflow, create_test_analytics};
// Create a simple test workflow
let workflow = create_test_workflow("test", 5);
assert_eq!(workflow.nodes.len(), 5);
// Create mock analytics data
let analytics = create_test_analytics("test", 100, 0.85);
assert_eq!(analytics.execution_stats.total_executions, 100);
assert_eq!(analytics.execution_stats.success_rate, 0.85);Functions§
- create_
branching_ workflow - Create a branching test workflow with a switch node
- create_
loop_ workflow - Create a workflow with a loop for testing iteration
- create_
test_ analytics - Create mock analytics data for testing
- create_
test_ edge - Create a test edge connecting two nodes
- create_
test_ execution_ context - Create a test execution context with the given workflow ID
- create_
test_ llm_ node - Create a simple LLM node for testing
- create_
test_ metadata - Create a test workflow metadata with the given name
- create_
test_ node_ result - Create a test node execution result with success status
- create_
test_ workflow - Create a simple test workflow with the specified number of nodes
- create_
test_ workflow_ batch - Create a batch of test workflows with different configurations