2019-09-18 16:44:27 +01:00
|
|
|
package home
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestWhois(t *testing.T) {
|
2019-10-07 17:13:06 +01:00
|
|
|
w := Whois{timeoutMsec: 5000}
|
|
|
|
resp, err := w.queryAll("8.8.8.8")
|
2019-09-18 16:44:27 +01: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")
|
|
|
|
}
|