Download codex-rs/cli/tests/debug_models.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/cli/tests/debug_models.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/cli/tests/debug_models.rs
-
curl -L -o debug_models.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/cli/tests/debug_models.rs
1.3 kB
| use std::path::Path; | |
| use anyhow::Result; | |
| use tempfile::TempDir; | |
| fn codex_command(codex_home: &Path) -> Result<assert_cmd::Command> { | |
| let mut cmd = assert_cmd::Command::new(codex_utils_cargo_bin::cargo_bin("codex")?); | |
| cmd.env("CODEX_HOME", codex_home); | |
| Ok(cmd) | |
| } | |
| fn debug_models_bundled_prints_json() -> Result<()> { | |
| let codex_home = TempDir::new()?; | |
| let mut cmd = codex_command(codex_home.path())?; | |
| let output = cmd.args(["debug", "models", "--bundled"]).output()?; | |
| assert!(output.status.success()); | |
| let stdout = String::from_utf8(output.stdout)?; | |
| let value: serde_json::Value = serde_json::from_str(&stdout)?; | |
| assert!(value["models"].is_array()); | |
| assert!(!value["models"].as_array().unwrap_or(&Vec::new()).is_empty()); | |
| Ok(()) | |
| } | |
| fn debug_models_default_prints_json_without_auth() -> Result<()> { | |
| let codex_home = TempDir::new()?; | |
| let mut cmd = codex_command(codex_home.path())?; | |
| let output = cmd.args(["debug", "models"]).output()?; | |
| assert!(output.status.success()); | |
| let stdout = String::from_utf8(output.stdout)?; | |
| let value: serde_json::Value = serde_json::from_str(&stdout)?; | |
| assert!(value["models"].is_array()); | |
| assert!(!value["models"].as_array().unwrap_or(&Vec::new()).is_empty()); | |
| Ok(()) | |
| } | |