MCPcopy
hub / github.com/grpc/grpc-go / TestInfo

Method TestInfo

credentials/alts/alts_test.go:151–165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func (s) TestInfo(t *testing.T) {
152 // This is not testing any handshaker functionality, so it's fine to only
153 // use NewServerCreds and not NewClientCreds.
154 c := NewServerCreds(DefaultServerOptions())
155 info := c.Info()
156 if got, want := info.SecurityProtocol, "alts"; got != want {
157 t.Errorf("info.SecurityProtocol=%v, want %v", got, want)
158 }
159 if got, want := info.SecurityVersion, "1.0"; got != want {
160 t.Errorf("info.SecurityVersion=%v, want %v", got, want)
161 }
162 if got, want := info.ServerName, ""; got != want {
163 t.Errorf("info.ServerName=%v, want %v", got, want)
164 }
165}
166
167func (s) TestCompareRPCVersions(t *testing.T) {
168 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 4

DefaultServerOptionsFunction · 0.85
NewServerCredsFunction · 0.70
InfoMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected