()
| 1006 | |
| 1007 | #[test] |
| 1008 | fn test_llm_config_specific_provider_model() { |
| 1009 | let model: ModelConfig = serde_json::from_value(serde_json::json!({ |
| 1010 | "id": "claude-3", |
| 1011 | "name": "Claude 3" |
| 1012 | })) |
| 1013 | .unwrap(); |
| 1014 | |
| 1015 | let config = CodeConfig { |
| 1016 | providers: vec![ProviderConfig { |
| 1017 | name: "anthropic".to_string(), |
| 1018 | api_key: Some("sk-test".to_string()), |
| 1019 | base_url: None, |
| 1020 | headers: HashMap::new(), |
| 1021 | session_id_header: None, |
| 1022 | models: vec![model], |
| 1023 | }], |
| 1024 | ..Default::default() |
| 1025 | }; |
| 1026 | |
| 1027 | let llm = config.llm_config("anthropic", "claude-3"); |
| 1028 | assert!(llm.is_some()); |
| 1029 | let llm = llm.unwrap(); |
| 1030 | assert_eq!(llm.provider, "anthropic"); |
| 1031 | assert_eq!(llm.model, "claude-3"); |
| 1032 | } |
| 1033 | |
| 1034 | #[test] |
| 1035 | fn test_llm_config_missing_provider() { |
nothing calls this directly
no test coverage detected