blob: 2c81815bea03636701af3e2289a3975b569be2b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package testhelper_test
import (
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"google.golang.org/grpc"
)
func TestSetCtxGrpcMethod(t *testing.T) {
expectFullMethodName := "/pinkypb/TakeOverTheWorld.SNARF"
ctx := testhelper.Context(t)
ctx = testhelper.SetCtxGrpcMethod(ctx, expectFullMethodName)
actualFullMethodName, ok := grpc.Method(ctx)
require.True(t, ok, "expected context to contain server transport stream")
require.Equal(t, expectFullMethodName, actualFullMethodName)
}
|