mirror of
https://github.com/openai/codex.git
synced 2026-05-02 10:26:45 +00:00
tests: submit websocket turns with permission profiles
This commit is contained in:
@@ -38,8 +38,11 @@ async fn websocket_test_codex_shell_chain() -> Result<()> {
|
||||
let mut builder = test_codex().with_windows_cmd_shell();
|
||||
|
||||
let test = builder.build_with_websocket_server(&server).await?;
|
||||
test.submit_turn_with_policy("run the echo command", test.config.legacy_sandbox_policy())
|
||||
.await?;
|
||||
test.submit_turn_with_permission_profile(
|
||||
"run the echo command",
|
||||
test.config.permissions.permission_profile(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
let connection = server.single_connection();
|
||||
assert_eq!(connection.len(), 2);
|
||||
@@ -82,7 +85,7 @@ async fn websocket_first_turn_uses_startup_prewarm_and_create() -> Result<()> {
|
||||
|
||||
let mut builder = test_codex();
|
||||
let test = builder.build_with_websocket_server(&server).await?;
|
||||
test.submit_turn_with_policy("hello", test.config.legacy_sandbox_policy())
|
||||
test.submit_turn_with_permission_profile("hello", test.config.permissions.permission_profile())
|
||||
.await?;
|
||||
|
||||
assert_eq!(server.handshakes().len(), 1);
|
||||
@@ -129,7 +132,7 @@ async fn websocket_first_turn_handles_handshake_delay_with_startup_prewarm() ->
|
||||
|
||||
let mut builder = test_codex();
|
||||
let test = builder.build_with_websocket_server(&server).await?;
|
||||
test.submit_turn_with_policy("hello", test.config.legacy_sandbox_policy())
|
||||
test.submit_turn_with_permission_profile("hello", test.config.permissions.permission_profile())
|
||||
.await?;
|
||||
|
||||
assert_eq!(server.handshakes().len(), 1);
|
||||
@@ -182,8 +185,11 @@ async fn websocket_v2_test_codex_shell_chain() -> Result<()> {
|
||||
});
|
||||
|
||||
let test = builder.build_with_websocket_server(&server).await?;
|
||||
test.submit_turn_with_policy("run the echo command", test.config.legacy_sandbox_policy())
|
||||
.await?;
|
||||
test.submit_turn_with_permission_profile(
|
||||
"run the echo command",
|
||||
test.config.permissions.permission_profile(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
let connection = server.single_connection();
|
||||
assert_eq!(connection.len(), 3);
|
||||
|
||||
Reference in New Issue
Block a user