()
| 219 | |
| 220 | #[test] |
| 221 | fn mock_openai_embeddings() { |
| 222 | let route = make_route( |
| 223 | "mock://test", |
| 224 | &["openai_embeddings"], |
| 225 | "text-embedding-3-small", |
| 226 | ); |
| 227 | let resp = mock_response(&route, "openai_embeddings"); |
| 228 | assert_eq!(resp.status, 200); |
| 229 | |
| 230 | let body: serde_json::Value = serde_json::from_slice(&resp.body).unwrap(); |
| 231 | assert_eq!(body["object"], "list"); |
| 232 | assert_eq!(body["model"], "text-embedding-3-small"); |
| 233 | assert_eq!(body["data"][0]["object"], "embedding"); |
| 234 | assert!( |
| 235 | body["data"][0]["embedding"].is_array(), |
| 236 | "embedding must be a numeric array, got: {body}" |
| 237 | ); |
| 238 | } |
| 239 | |
| 240 | #[test] |
| 241 | fn mock_generic_protocol() { |
nothing calls this directly
no test coverage detected