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

Function testStreamClientInterceptor

test/end2end_test.go:4387–4413  ·  view source on GitHub ↗
(t *testing.T, e env)

Source from the content-addressed store, hash-verified

4385}
4386
4387func testStreamClientInterceptor(t *testing.T, e env) {
4388 te := newTest(t, e)
4389 te.streamClientInt = failOkayStream
4390 te.startServer(&testServer{security: e.security})
4391 defer te.tearDown()
4392
4393 tc := testgrpc.NewTestServiceClient(te.clientConn())
4394 respParam := []*testpb.ResponseParameters{
4395 {
4396 Size: int32(1),
4397 },
4398 }
4399 payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(1))
4400 if err != nil {
4401 t.Fatal(err)
4402 }
4403 req := &testpb.StreamingOutputCallRequest{
4404 ResponseType: testpb.PayloadType_COMPRESSABLE,
4405 ResponseParameters: respParam,
4406 Payload: payload,
4407 }
4408 ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
4409 defer cancel()
4410 if _, err := tc.StreamingOutputCall(ctx, req); status.Code(err) != codes.NotFound {
4411 t.Fatalf("%v.StreamingOutputCall(_) = _, %v, want _, error code %s", tc, err, codes.NotFound)
4412 }
4413}
4414
4415func (s) TestUnaryServerInterceptor(t *testing.T) {
4416 for _, e := range listTestEnv() {

Callers 1

Calls 9

StreamingOutputCallMethod · 0.95
newPayloadFunction · 0.85
CodeMethod · 0.80
newTestFunction · 0.70
FatalMethod · 0.65
FatalfMethod · 0.65
startServerMethod · 0.45
tearDownMethod · 0.45
clientConnMethod · 0.45

Tested by

no test coverage detected