()
| 259 | |
| 260 | #[test] |
| 261 | fn test_default_llm_config() { |
| 262 | let config = CodeConfig { |
| 263 | default_model: Some("anthropic/claude-sonnet-4".to_string()), |
| 264 | providers: vec![ProviderConfig { |
| 265 | name: "anthropic".to_string(), |
| 266 | api_key: Some("test-api-key".to_string()), |
| 267 | base_url: Some("https://api.anthropic.com".to_string()), |
| 268 | headers: HashMap::new(), |
| 269 | session_id_header: None, |
| 270 | models: vec![ModelConfig { |
| 271 | id: "claude-sonnet-4".to_string(), |
| 272 | name: "Claude Sonnet 4".to_string(), |
| 273 | family: "claude-sonnet".to_string(), |
| 274 | api_key: None, |
| 275 | base_url: None, |
| 276 | headers: HashMap::new(), |
| 277 | session_id_header: None, |
| 278 | attachment: false, |
| 279 | reasoning: false, |
| 280 | tool_call: true, |
| 281 | temperature: true, |
| 282 | release_date: None, |
| 283 | modalities: ModelModalities::default(), |
| 284 | cost: ModelCost::default(), |
| 285 | limit: ModelLimit::default(), |
| 286 | }], |
| 287 | }], |
| 288 | ..Default::default() |
| 289 | }; |
| 290 | |
| 291 | let llm_config = config.default_llm_config().unwrap(); |
| 292 | assert_eq!(llm_config.provider, "anthropic"); |
| 293 | assert_eq!(llm_config.model, "claude-sonnet-4"); |
| 294 | assert_eq!(llm_config.api_key.expose(), "test-api-key"); |
| 295 | assert_eq!( |
| 296 | llm_config.base_url, |
| 297 | Some("https://api.anthropic.com".to_string()) |
| 298 | ); |
| 299 | } |
| 300 | |
| 301 | #[test] |
| 302 | fn test_model_api_key_override() { |
nothing calls this directly
no test coverage detected