blob: 903895727412e76f20c87d99eb5ab7130e8a0f53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package testhelper_test
import (
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper"
"google.golang.org/grpc"
)
func TestSetCtxGrpcMethod(t *testing.T) {
expectFullMethodName := "/pinkypb/TakeOverTheWorld.SNARF"
ctx, cancel := testhelper.Context()
defer cancel()
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)
}
|