mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
Consolidate code mode output helper tests (#39969)
## What changed - Cover object serialization through the `text()` helper directly in the code mode runtime suite. - Remove redundant core integration coverage for serialized text and rejected image outputs. GitOrigin-RevId: f465b8361e9d725a7246994d9c41e9d01c969011
This commit is contained in:
@@ -1055,6 +1055,32 @@ text(JSON.stringify(returnsUndefined));
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn text_helper_serializes_objects() {
|
||||
let service = InProcessCodeModeSession::new();
|
||||
|
||||
let response = execute(
|
||||
&service,
|
||||
ExecuteRequest {
|
||||
source: "text({ json: true });".to_string(),
|
||||
yield_time_ms: None,
|
||||
..execute_request("")
|
||||
},
|
||||
)
|
||||
.await;
|
||||
|
||||
assert_eq!(
|
||||
response,
|
||||
RuntimeResponse::Result {
|
||||
cell_id: cell_id("1"),
|
||||
content_items: vec![FunctionCallOutputContentItem::InputText {
|
||||
text: r#"{"json":true}"#.to_string(),
|
||||
}],
|
||||
error_text: None,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn text_helper_surfaces_stringify_errors() {
|
||||
let service = InProcessCodeModeSession::new();
|
||||
|
||||
Reference in New Issue
Block a user