tests: replace mount_sse_once_match with mount_sse_once for SSE mocking (#6640)

This commit is contained in:
pakrym-oai
2025-11-13 18:04:05 -08:00
committed by GitHub
parent 2a6e9b20df
commit 6c384eb9c6
17 changed files with 85 additions and 142 deletions

View File

@@ -4,7 +4,6 @@
use core_test_support::responses;
use core_test_support::test_codex_exec::test_codex_exec;
use serde_json::Value;
use wiremock::matchers::any;
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn exec_includes_output_schema_in_request() -> anyhow::Result<()> {
@@ -28,7 +27,7 @@ async fn exec_includes_output_schema_in_request() -> anyhow::Result<()> {
responses::ev_assistant_message("m1", "fixture hello"),
responses::ev_completed("resp1"),
]);
let response_mock = responses::mount_sse_once_match(&server, any(), body).await;
let response_mock = responses::mount_sse_once(&server, body).await;
test.cmd_with_server(&server)
.arg("--skip-git-repo-check")

View File

@@ -3,7 +3,6 @@
use core_test_support::responses;
use core_test_support::test_codex_exec::test_codex_exec;
use wiremock::matchers::any;
/// Verify that when the server reports an error, `codex-exec` exits with a
/// non-zero status code so automation can detect failures.
@@ -21,7 +20,7 @@ async fn exits_non_zero_when_server_reports_error() -> anyhow::Result<()> {
"error": {"code": "rate_limit_exceeded", "message": "synthetic server error"}
}
})]);
responses::mount_sse_once_match(&server, any(), body).await;
responses::mount_sse_once(&server, body).await;
test.cmd_with_server(&server)
.arg("--skip-git-repo-check")