AdGuardHome/home/whois_test.go
Simon Zolin 37fe3c148f * whois: use whois.arin.net
+ robust redirect mechanism
* decrease timeout 30sec -> 5sec
* faster response parsing
* don't use likexian/whois-go package
2019-10-09 18:03:22 +03:00

18 lines
357 B
Go

package home
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestWhois(t *testing.T) {
w := Whois{timeoutMsec: 5000}
resp, err := w.queryAll("8.8.8.8")
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")
}