pub struct Fixture {Show 13 fields
pub id: String,
pub category: Option<String>,
pub description: String,
pub tags: Vec<String>,
pub skip: Option<SkipDirective>,
pub env: Option<FixtureEnv>,
pub call: Option<String>,
pub input: Value,
pub mock_response: Option<MockResponse>,
pub visitor: Option<VisitorSpec>,
pub assertions: Vec<Assertion>,
pub source: String,
pub http: Option<HttpFixture>,
}Expand description
A single e2e test fixture.
Fields§
§id: StringUnique identifier (used as test function name).
category: Option<String>Optional category (defaults to parent directory name).
description: StringHuman-readable description.
Optional tags for filtering.
skip: Option<SkipDirective>Skip directive.
env: Option<FixtureEnv>Environment variable requirements (used by smoke/live tests).
call: Option<String>Named call config to use (references [e2e.calls.<name>]).
When omitted, uses the default [e2e.call].
input: ValueInput data passed to the function under test.
mock_response: Option<MockResponse>Optional mock HTTP response for testing HTTP clients.
visitor: Option<VisitorSpec>Optional visitor specification for visitor pattern tests.
assertions: Vec<Assertion>List of assertions to check.
source: StringSource file path (populated during loading).
http: Option<HttpFixture>HTTP server test specification. When present, this fixture tests an HTTP handler rather than a function call.
Implementations§
Source§impl Fixture
impl Fixture
Sourcepub fn is_http_test(&self) -> bool
pub fn is_http_test(&self) -> bool
Returns true if this is an HTTP server test fixture.
Sourcepub fn needs_mock_server(&self) -> bool
pub fn needs_mock_server(&self) -> bool
Returns true if this fixture requires a mock HTTP server.
This is true when either mock_response (liter-llm shape) or
http.expected_response (consumer shape) is present.
Sourcepub fn as_mock_response(&self) -> Option<MockResponse>
pub fn as_mock_response(&self) -> Option<MockResponse>
Returns the effective mock response for this fixture, bridging both schemas:
- liter-llm shape:
mock_response: { status, body, stream_chunks } - consumer shape:
http.expected_response: { status_code, body, headers }
Returns None if neither schema is present.
Sourcepub fn is_streaming_mock(&self) -> bool
pub fn is_streaming_mock(&self) -> bool
Returns true if the mock response uses streaming (SSE).
Sourcepub fn resolved_category(&self) -> String
pub fn resolved_category(&self) -> String
Get the resolved category (explicit or from source directory).