Module test_helpers

Module test_helpers 

Source
Expand description

Public test utilities for use in downstream crates. Test utilities for turbomcp-protocol

This module provides shared test helpers used throughout the crate’s tests. Following the pattern from axum and tokio, these utilities are public to allow downstream crates to use them in their tests.

§Organization

All test fixtures and helpers are in this single module for simplicity. As the test suite grows, this can be split into submodules if needed.

§Usage

#[cfg(test)]
mod tests {
    use super::*;
    use crate::test_helpers::*;

    #[test]
    fn my_test() {
        let request = test_request();
        assert_valid(&result);
    }
}

Functions§

assert_invalid
Assert that validation failed
assert_valid
Assert that validation passed without warnings
test_initialize_request
Create a valid initialize request for testing
test_prompt
Create a valid prompt for testing
test_prompt_argument
Create a prompt argument for testing
test_request
Create a standard test JSON-RPC request
test_resource
Create a valid resource for testing
test_tool
Create a valid tool for testing