mirror of
https://github.com/openai/codex.git
synced 2026-11-01 19:33:35 +00:00
Fix test suit
This commit is contained in:
@@ -2,6 +2,7 @@ use std::error::Error;
|
||||
use std::fs;
|
||||
|
||||
use assert_cmd::Command;
|
||||
use core_test_support::load_sse_fixture_with_id;
|
||||
use tempfile::TempDir;
|
||||
|
||||
#[test]
|
||||
@@ -13,11 +14,21 @@ fn prompt_harness_streams_session_event() -> Result<(), Box<dyn Error>> {
|
||||
let prompt_path = workspace.path().join("override.md");
|
||||
fs::write(&prompt_path, "system override contents")?;
|
||||
|
||||
// Feed the harness from a local SSE fixture so the test never hits the network.
|
||||
let sse_path = workspace.path().join("response.sse");
|
||||
let sse_contents = load_sse_fixture_with_id(
|
||||
"tests/fixtures/completed_template.json",
|
||||
"prompt-harness-response",
|
||||
);
|
||||
fs::write(&sse_path, sse_contents)?;
|
||||
|
||||
let script_path = workspace.path().join("driver.py");
|
||||
fs::write(&script_path, driver_script())?;
|
||||
|
||||
let mut cmd = Command::cargo_bin("prompt_harness")?;
|
||||
cmd.env("CODEX_HOME", &codex_home)
|
||||
.env("CODEX_RS_SSE_FIXTURE", &sse_path)
|
||||
.env("OPENAI_API_KEY", "test-key")
|
||||
.arg("--system-prompt-file")
|
||||
.arg(&prompt_path)
|
||||
.arg("python3")
|
||||
|
||||
Reference in New Issue
Block a user