MCPcopy
hub / github.com/etcd-io/etcd / TestGetSRVService

Function TestGetSRVService

client/pkg/srv/srv_test.go:269–304  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

267}
268
269func TestGetSRVService(t *testing.T) {
270 tests := []struct {
271 scheme string
272 serviceName string
273
274 expected string
275 }{
276 {
277 "https",
278 "",
279 "etcd-client-ssl",
280 },
281 {
282 "http",
283 "",
284 "etcd-client",
285 },
286 {
287 "https",
288 "foo",
289 "etcd-client-ssl-foo",
290 },
291 {
292 "http",
293 "bar",
294 "etcd-client-bar",
295 },
296 }
297
298 for i, tt := range tests {
299 service := GetSRVService("etcd-client", tt.serviceName, tt.scheme)
300 if strings.Compare(service, tt.expected) != 0 {
301 t.Errorf("#%d: service = %s, want %s", i, service, tt.expected)
302 }
303 }
304}

Callers

nothing calls this directly

Calls 3

GetSRVServiceFunction · 0.85
CompareMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…