MCPcopy
hub / github.com/apache/devlake / TestCheckDNS

Function TestCheckDNS

backend/core/utils/network_helper_test.go:24–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22)
23
24func TestCheckDNS(t *testing.T) {
25 var hostname = "baidu.com"
26 var err = CheckDNS(hostname)
27 if err != nil {
28 t.Error(err)
29 }
30
31 var invalidHostname = "baidu.abc"
32 err = CheckDNS(invalidHostname)
33 t.Log(err)
34 if err == nil {
35 t.Errorf("Expected %s, Got nil", "failed")
36 }
37}
38
39func TestResolvePort(t *testing.T) {
40 port, err := ResolvePort("80", "https")

Callers

nothing calls this directly

Calls 3

CheckDNSFunction · 0.85
ErrorMethod · 0.65
LogMethod · 0.65

Tested by

no test coverage detected