mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-24 22:15:45 +03:00
37fe3c148f
+ robust redirect mechanism * decrease timeout 30sec -> 5sec * faster response parsing * don't use likexian/whois-go package
17 lines
357 B
Go
17 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")
|
|
}
|