MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / mock_openai_chat_completion

Function mock_openai_chat_completion

crates/openshell-router/src/mock.rs:191–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

189
190 #[test]
191 fn mock_openai_chat_completion() {
192 let route = make_route("mock://test", &["openai_chat_completions"], "gpt-4");
193 let resp = mock_response(&route, "openai_chat_completions");
194 assert_eq!(resp.status, 200);
195
196 let body: serde_json::Value = serde_json::from_slice(&resp.body).unwrap();
197 assert_eq!(body["model"], "gpt-4");
198 assert_eq!(body["object"], "chat.completion");
199 assert_eq!(
200 body["choices"][0]["message"]["content"],
201 "Hello from openshell mock backend"
202 );
203 }
204
205 #[test]
206 fn mock_anthropic_messages() {

Callers

nothing calls this directly

Calls 2

mock_responseFunction · 0.85
make_routeFunction · 0.70

Tested by

no test coverage detected