blob: 6b1272c3f4b335f6e95d206770ef9f591f11e26b (
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/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)
}
|