MCPcopy Create free account
hub / github.com/clawshell/clawshell / test_proxy_preserves_query_params

Function test_proxy_preserves_query_params

src/app/tests.rs:163–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161
162#[tokio::test]
163async fn test_proxy_preserves_query_params() {
164 let mock_server = MockServer::start().await;
165
166 Mock::given(method("GET"))
167 .and(path("/v1/models"))
168 .and(header("authorization", "Bearer sk-real-1"))
169 .respond_with(
170 ResponseTemplate::new(200)
171 .set_body_json(serde_json::json!({"data": [{"id": "gpt-4"}]})),
172 )
173 .mount(&mock_server)
174 .await;
175
176 let app = make_app(&mock_server.uri());
177 let req = Request::builder()
178 .method("GET")
179 .uri("/v1/models?limit=10")
180 .header("authorization", "Bearer vk-test-1")
181 .body(Body::empty())
182 .unwrap();
183
184 let resp = app.oneshot(req).await.unwrap();
185 assert_eq!(resp.status(), StatusCode::OK);
186}
187
188#[tokio::test]
189async fn test_proxy_forwards_upstream_errors() {

Callers

nothing calls this directly

Calls 1

make_appFunction · 0.85

Tested by

no test coverage detected