()
| 357 | |
| 358 | #[tokio::test] |
| 359 | async fn test_clean_request_passes_through() { |
| 360 | let mock_server = MockServer::start().await; |
| 361 | |
| 362 | Mock::given(method("POST")) |
| 363 | .and(path("/v1/chat/completions")) |
| 364 | .respond_with( |
| 365 | ResponseTemplate::new(200).set_body_json(serde_json::json!({"id": "chatcmpl-ok"})), |
| 366 | ) |
| 367 | .mount(&mock_server) |
| 368 | .await; |
| 369 | |
| 370 | let app = make_app(&mock_server.uri()); |
| 371 | let body = r#"{"messages":[{"role":"user","content":"Hello, how are you?"}]}"#; |
| 372 | let req = Request::builder() |
| 373 | .method("POST") |
| 374 | .uri("/v1/chat/completions") |
| 375 | .header("authorization", "Bearer vk-test-1") |
| 376 | .header("content-type", "application/json") |
| 377 | .body(Body::from(body)) |
| 378 | .unwrap(); |
| 379 | let resp = app.oneshot(req).await.unwrap(); |
| 380 | assert_eq!(resp.status(), StatusCode::OK); |
| 381 | } |
| 382 | |
| 383 | // ========== Streaming Tests ========== |
| 384 |
nothing calls this directly
no test coverage detected