forked from grpc-ecosystem/go-grpc-middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrace_notrace_test.go
More file actions
42 lines (36 loc) · 775 Bytes
/
trace_notrace_test.go
File metadata and controls
42 lines (36 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) The go-grpc-middleware Authors.
// Licensed under the Apache License 2.0.
//go:build retrynotrace
package retry
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_traceFromCtx(t *testing.T) {
tr := notrace{}
ctx := context.Background()
type args struct {
ctx context.Context
}
tests := []struct {
name string
args args
want notrace
want1 bool
}{
{
name: "should return notrace",
args: args{ctx: ctx},
want: tr,
want1: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, got1 := traceFromCtx(tt.args.ctx)
assert.Equalf(t, tt.want, got, "traceFromCtx(%v)", tt.args.ctx)
assert.Equalf(t, tt.want1, got1, "traceFromCtx(%v)", tt.args.ctx)
})
}
}