Skip to content

Git designed for AI agents.

545 B
Raw Blame
package testhelper_test

import (
	"testing"

	"github.com/feder-cr/git-ai/internal/testhelper"
	"github.com/stretchr/testify/require"
	"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)
}