MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestFindPrimaryAddr

Function TestFindPrimaryAddr

base/util_test.go:493–504  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

491}
492
493func TestFindPrimaryAddr(t *testing.T) {
494 ip, err := FindPrimaryAddr()
495 if err != nil && strings.Contains(err.Error(), "network is unreachable") {
496 // Skip test if dial fails.
497 // This is to allow tests to be run offline/without third-party dependencies.
498 t.Skipf("WARNING: network is unreachable: %s", err)
499 }
500
501 assert.NotEqual(t, nil, ip)
502 assert.NotEqual(t, "", ip.String())
503 assert.NotEqual(t, "<nil>", ip.String())
504}
505
506func TestReplaceAll(t *testing.T) {
507 tests := []struct {

Callers

nothing calls this directly

Calls 4

FindPrimaryAddrFunction · 0.85
ContainsMethod · 0.65
StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected