MCPcopy
hub / github.com/mudler/LocalAI / newInProcClient

Function newInProcClient

backend/go/cloud-proxy/proxy_test.go:21–26  ·  view source on GitHub ↗

helper: run a CloudProxy in-process via grpc.Provide so tests can call Forward through the public Backend interface without listening on a real socket.

(t *testing.T, proxy *CloudProxy)

Source from the content-addressed store, hash-verified

19// call Forward through the public Backend interface without listening
20// on a real socket.
21func newInProcClient(t *testing.T, proxy *CloudProxy) grpc.Backend {
22 t.Helper()
23 addr := "test://" + t.Name()
24 grpc.Provide(addr, proxy)
25 return grpc.NewClient(addr, true, nil, false)
26}
27
28func TestForward_PassthroughEcho(t *testing.T) {
29 g := NewWithT(t)

Calls 3

ProvideFunction · 0.92
NewClientFunction · 0.92
NameMethod · 0.65

Tested by

no test coverage detected