fix minor typos and remove grpc.Codec related code in TestInterceptorCanAccessCallOptions (#1929)

This commit is contained in:
lyuxuan 2018-03-19 14:19:42 -07:00 коммит произвёл GitHub
Родитель 211a7b7ec0
Коммит 738eb6b62f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -291,7 +291,7 @@ func PerRPCCredentials(creds credentials.PerRPCCredentials) CallOption {
return PerRPCCredsCallOption{Creds: creds}
}
// PerRPCCredsCallOption is a CallOption that indicates the the per-RPC
// PerRPCCredsCallOption is a CallOption that indicates the per-RPC
// credentials to use for the call.
// This is an EXPERIMENTAL API.
type PerRPCCredsCallOption struct {

Просмотреть файл

@ -1244,7 +1244,7 @@ func testFailFast(t *testing.T, e env) {
if _, err := tc.EmptyCall(ctx, &testpb.Empty{}); err != nil {
t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
}
// Stop the server and tear down all the exisiting connections.
// Stop the server and tear down all the existing connections.
te.srv.Stop()
// Loop until the server teardown is propagated to the client.
for {
@ -5901,7 +5901,6 @@ func TestInterceptorCanAccessCallOptions(t *testing.T) {
maxSendSize []int
compressor []string
subtype []string
codec []grpc.Codec
}
var observedOpts observedOptions
populateOpts := func(opts []grpc.CallOption) {
@ -5925,8 +5924,6 @@ func TestInterceptorCanAccessCallOptions(t *testing.T) {
observedOpts.compressor = append(observedOpts.compressor, o.CompressorType)
case grpc.ContentSubtypeCallOption:
observedOpts.subtype = append(observedOpts.subtype, o.ContentSubtype)
case grpc.CustomCodecCallOption:
observedOpts.codec = append(observedOpts.codec, o.Codec)
}
}
}
@ -5972,20 +5969,17 @@ func TestInterceptorCanAccessCallOptions(t *testing.T) {
observedOpts = observedOptions{} // reset
var codec errCodec
tc.StreamingInputCall(context.Background(),
grpc.FailFast(true),
grpc.MaxCallSendMsgSize(2020),
grpc.UseCompressor("comp-type"),
grpc.CallContentSubtype("json"),
grpc.CallCustomCodec(&codec))
grpc.CallContentSubtype("json"))
expected = observedOptions{
failFast: []bool{false, true},
maxRecvSize: []int{1010},
maxSendSize: []int{2020},
compressor: []string{"comp-type"},
subtype: []string{"json"},
codec: []grpc.Codec{&codec},
}
if !reflect.DeepEqual(expected, observedOpts) {