Option C Tools
Loading...
Searching...
No Matches
tests_mcp.test_mcp_integration Namespace Reference

Classes

class  TestAllNineToolsEndToEnd
class  TestRateLimiting
class  TestPolicyEnforcement
class  TestValidationFailure
class  TestT09ContextPoisoning
class  TestRedactionIntegration

Functions

McpMetrics _isolated_metrics ()
tuple[ServerState, McpAuditLogger_make_state (Path tmp_path, str sandbox_output='{"tool":"test", "exit_code":0}', int sandbox_exit_code=0, str profile="default", bool safe_mode=False, int rate_limit=30, str session_id="integration-test-session")

Detailed Description

Purpose
-------
Integration tests for the oct-mcp six-layer pipeline.

Responsibilities
----------------
- Verify all 9 tools end-to-end via mock sandbox.
- Verify T-09 (context poisoning) and T-11 (prompt injection) defences.
- Verify rate limiting, combined policy + validator, and audit records.

Diagnostics
-----------
Domain: MCP-TESTS
Levels:
    L2 — test lifecycle
    L3 — assertion details
    L4 — deep tracing

Contracts
---------
- Tests use mock sandbox and ``tmp_path``; no real subprocess is
  spawned.

Function Documentation

◆ _isolated_metrics()

McpMetrics tests_mcp.test_mcp_integration._isolated_metrics ( )
protected
McpMetrics on a private CollectorRegistry — avoids
``Duplicated timeseries`` collisions across tests.

Definition at line 50 of file test_mcp_integration.py.

Here is the caller graph for this function:

◆ _make_state()

tuple[ServerState, McpAuditLogger] tests_mcp.test_mcp_integration._make_state ( Path tmp_path,
str sandbox_output = '{"tool": "test", "exit_code": 0}',
int sandbox_exit_code = 0,
str profile = "default",
bool safe_mode = False,
int rate_limit = 30,
str session_id = "integration-test-session" )
protected
Construct a ServerState with a mock sandbox for integration tests.

Definition at line 59 of file test_mcp_integration.py.

Here is the call graph for this function:
Here is the caller graph for this function: