mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
fixing tests
This commit is contained in:
@@ -580,7 +580,7 @@ mod tests {
|
||||
{"role":"system","content":prompt.get_full_instructions(&config.model)},
|
||||
{"role":"user","content":"hi"},
|
||||
{"role":"assistant","content":"ok"},
|
||||
{"role":"assistant","tool_calls":[{"id":"c1","type":"function","function":{"name":"foo","arguments":"{}"}}]},
|
||||
{"role":"assistant", "content": null, "tool_calls":[{"id":"c1","type":"function","function":{"name":"foo","arguments":"{}"}}]},
|
||||
{"role":"tool","tool_call_id":"c1","content":"out"}
|
||||
]);
|
||||
|
||||
|
||||
@@ -66,13 +66,10 @@ async fn chat_mode_stream_cli() {
|
||||
.env("OPENAI_BASE_URL", format!("{}/v1", server.uri()));
|
||||
|
||||
let output = cmd.output().unwrap();
|
||||
println!("Status: {}", output.status);
|
||||
println!("Stdout:\n{}", String::from_utf8_lossy(&output.stdout));
|
||||
println!("Stderr:\n{}", String::from_utf8_lossy(&output.stderr));
|
||||
assert!(output.status.success());
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
assert!(stdout.contains("hi"));
|
||||
assert_eq!(stdout.matches("hi").count(), 1);
|
||||
let hi_lines = stdout.lines().filter(|line| line.trim() == "hi").count();
|
||||
assert_eq!(hi_lines, 1, "Expected exactly one line with 'hi'");
|
||||
|
||||
server.verify().await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user