MCPcopy
hub / github.com/grpc/grpc-go / TestCredsBundlePerRPCCredentials

Method TestCredsBundlePerRPCCredentials

test/creds_test.go:132–148  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func (s) TestCredsBundlePerRPCCredentials(t *testing.T) {
133 te := newTest(t, env{name: "creds-bundle", network: "tcp", security: "empty"})
134 te.tapHandle = authHandle
135 te.customDialOptions = []grpc.DialOption{
136 grpc.WithCredentialsBundle(&testCredsBundle{t: t, mode: bundlePerRPCOnly}),
137 }
138 te.startServer(&testServer{})
139 defer te.tearDown()
140
141 cc := te.clientConn()
142 tc := testgrpc.NewTestServiceClient(cc)
143 ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
144 defer cancel()
145 if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil {
146 t.Fatalf("Test failed. Reason: %v", err)
147 }
148}
149
150type clientTimeoutCreds struct {
151 credentials.TransportCredentials

Callers

nothing calls this directly

Calls 7

EmptyCallMethod · 0.95
WithCredentialsBundleFunction · 0.92
newTestFunction · 0.70
FatalfMethod · 0.65
startServerMethod · 0.45
tearDownMethod · 0.45
clientConnMethod · 0.45

Tested by

no test coverage detected