frontend: resolve asn in dns/whois/fail order & fix tests
This commit is contained in:
22
frontend/whois_test.go
Normal file
22
frontend/whois_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWhois(t *testing.T) {
|
||||
setting.whoisServer = "whois.arin.net"
|
||||
result := whois("AS6939")
|
||||
if !strings.Contains(result, "HURRICANE") {
|
||||
t.Errorf("Whois AS6939 failed, got %s", result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWhoisWithoutServer(t *testing.T) {
|
||||
setting.whoisServer = ""
|
||||
result := whois("AS6939")
|
||||
if result != "" {
|
||||
t.Errorf("Whois AS6939 without server produced output, got %s", result)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user