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

Function testPerRPCCredentialsViaDialOptions

test/creds_test.go:332–346  ·  view source on GitHub ↗
(t *testing.T, e env)

Source from the content-addressed store, hash-verified

330}
331
332func testPerRPCCredentialsViaDialOptions(t *testing.T, e env) {
333 te := newTest(t, e)
334 te.tapHandle = authHandle
335 te.perRPCCreds = testPerRPCCredentials{authdata: authdata}
336 te.startServer(&testServer{security: e.security})
337 defer te.tearDown()
338
339 cc := te.clientConn()
340 tc := testgrpc.NewTestServiceClient(cc)
341 ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
342 defer cancel()
343 if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil {
344 t.Fatalf("Test failed. Reason: %v", err)
345 }
346}
347
348func (s) TestPerRPCCredentialsViaCallOptions(t *testing.T) {
349 for _, e := range listTestEnv() {

Calls 6

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

Tested by

no test coverage detected