Browse Source

Make GeoIP related tests more likely to work by default

Ask Bjørn Hansen 7 years ago
parent
commit
963a0fc418
2 changed files with 2 additions and 2 deletions
  1. 1 1
      targeting/geoip2/geoip2.go
  2. 1 1
      targeting/targeting_test.go

+ 1 - 1
targeting/geoip2/geoip2.go

@@ -38,7 +38,7 @@ type GeoIP2 struct {
 func init() {
 	dbFiles = map[geoType][]string{
 		countryDB: []string{"GeoIP2-Country.mmdb", "GeoLite2-Country.mmdb"},
-		asnDB:     []string{"GeoIP2-ISP.mmdb"},
+		asnDB:     []string{"GeoIP2-ASN.mmdb", "GeoLite2-ASN.mmdb"},
 		cityDB:    []string{"GeoIP2-City.mmdb", "GeoLite2-City.mmdb"},
 	}
 }

+ 1 - 1
targeting/targeting_test.go

@@ -52,7 +52,7 @@ func TestTargetParse(t *testing.T) {
 func TestGetTargets(t *testing.T) {
 	ip := net.ParseIP("207.171.1.1")
 
-	g, err := geoip2.New("../db")
+	g, err := geoip2.New(geoip2.FindDB())
 	if err != nil {
 		t.Fatalf("opening geoip2: %s", err)
 	}