Skip to content

Commit cf74423

Browse files
test: add recording assertion messages (praxis-proxy#737)
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent 9dc282f commit cf74423

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

tests/utils/src/recording.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,26 @@ mod tests {
8383
#[test]
8484
fn load_non_streaming() {
8585
let r = Recording::load("anthropic/messages/basic.json");
86-
assert!(!r.is_streaming());
87-
assert!(r.response.is_some());
88-
assert!(r.response_sse.is_none());
86+
assert!(!r.is_streaming(), "basic fixture should be non-streaming");
87+
assert!(r.response.is_some(), "basic fixture should include a JSON response");
88+
assert!(
89+
r.response_sse.is_none(),
90+
"basic fixture should not include an SSE response"
91+
);
8992
}
9093

9194
#[test]
9295
fn load_streaming() {
9396
let r = Recording::load("anthropic/messages/streaming_basic.json");
94-
assert!(r.is_streaming());
95-
assert!(r.response_sse.is_some());
96-
assert!(r.response.is_none());
97+
assert!(r.is_streaming(), "streaming fixture should be streaming");
98+
assert!(
99+
r.response_sse.is_some(),
100+
"streaming fixture should include an SSE response"
101+
);
102+
assert!(
103+
r.response.is_none(),
104+
"streaming fixture should not include a JSON response"
105+
);
97106
}
98107

99108
#[test]

0 commit comments

Comments
 (0)