2019-09-18 15:44:27 +00:00
|
|
|
package home
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestWhois(t *testing.T) {
|
2019-10-07 16:13:06 +00:00
|
|
|
w := Whois{timeoutMsec: 5000}
|
|
|
|
resp, err := w.queryAll("8.8.8.8")
|
2019-09-18 15:44:27 +00:00
|
|
|
assert.True(t, err == nil)
|
|
|
|
m := whoisParse(resp)
|
|
|
|
assert.True(t, m["orgname"] == "Google LLC")
|
|
|
|
assert.True(t, m["country"] == "US")
|
|
|
|
assert.True(t, m["city"] == "Mountain View")
|
|
|
|
}
|