9
9
)
10
10
11
11
func TestAnonymousIP (t * testing.T ) {
12
- reader , err := NewAnonymousIPReaderFromFile ("testdata/GeoIP2-Anonymous-IP-Test.mmdb" )
12
+ reader , err := NewAnonymousIPReaderFromFile ("testdata/maxmind/test-data/ GeoIP2-Anonymous-IP-Test.mmdb" )
13
13
if err != nil {
14
14
t .Fatal (err )
15
15
}
@@ -63,7 +63,7 @@ func TestReaderZeroLength(t *testing.T) {
63
63
}
64
64
65
65
func TestCity (t * testing.T ) {
66
- reader , err := NewCityReaderFromFile ("testdata/GeoIP2-City-Test.mmdb" )
66
+ reader , err := NewCityReaderFromFile ("testdata/maxmind/test-data/ GeoIP2-City-Test.mmdb" )
67
67
if err != nil {
68
68
t .Fatal (err )
69
69
}
@@ -133,7 +133,7 @@ func TestCity(t *testing.T) {
133
133
}
134
134
135
135
func TestConnectionType (t * testing.T ) {
136
- reader , err := NewConnectionTypeReaderFromFile ("testdata/GeoIP2-Connection-Type-Test.mmdb" )
136
+ reader , err := NewConnectionTypeReaderFromFile ("testdata/maxmind/test-data/ GeoIP2-Connection-Type-Test.mmdb" )
137
137
if err != nil {
138
138
t .Fatal (err )
139
139
}
@@ -142,21 +142,21 @@ func TestConnectionType(t *testing.T) {
142
142
if err != nil {
143
143
t .Fatal (err )
144
144
}
145
- if record != "Dialup " {
145
+ if record != "Cable/DSL " {
146
146
t .Fatal ()
147
147
}
148
148
149
149
record , err = reader .Lookup (net .ParseIP ("1.0.1.0" ))
150
150
if err != nil {
151
151
t .Fatal (err )
152
152
}
153
- if record != "Cable/DSL " {
153
+ if record != "Cellular " {
154
154
t .Fatal ()
155
155
}
156
156
}
157
157
158
158
func TestCountry (t * testing.T ) {
159
- reader , err := NewCountryReaderFromFile ("testdata/GeoIP2-Country-Test.mmdb" )
159
+ reader , err := NewCountryReaderFromFile ("testdata/maxmind/test-data/ GeoIP2-Country-Test.mmdb" )
160
160
if err != nil {
161
161
t .Fatal (err )
162
162
}
@@ -240,7 +240,7 @@ func TestCountry(t *testing.T) {
240
240
}
241
241
242
242
func TestDomain (t * testing.T ) {
243
- reader , err := NewDomainReaderFromFile ("testdata/GeoIP2-Domain-Test.mmdb" )
243
+ reader , err := NewDomainReaderFromFile ("testdata/maxmind/test-data/ GeoIP2-Domain-Test.mmdb" )
244
244
if err != nil {
245
245
t .Fatal (err )
246
246
}
@@ -263,7 +263,7 @@ func TestDomain(t *testing.T) {
263
263
}
264
264
265
265
func TestEnterprise (t * testing.T ) {
266
- reader , err := NewEnterpriseReaderFromFile ("testdata/GeoIP2-Enterprise-Test.mmdb" )
266
+ reader , err := NewEnterpriseReaderFromFile ("testdata/maxmind/test-data/ GeoIP2-Enterprise-Test.mmdb" )
267
267
if err != nil {
268
268
t .Fatal (err )
269
269
}
@@ -340,7 +340,7 @@ func TestEnterprise(t *testing.T) {
340
340
}
341
341
342
342
func TestISP (t * testing.T ) {
343
- reader , err := NewISPReaderFromFile ("testdata/GeoIP2-ISP-Test.mmdb" )
343
+ reader , err := NewISPReaderFromFile ("testdata/maxmind/test-data/ GeoIP2-ISP-Test.mmdb" )
344
344
if err != nil {
345
345
t .Fatal (err )
346
346
}
@@ -381,7 +381,7 @@ func TestISP(t *testing.T) {
381
381
}
382
382
383
383
func TestASN (t * testing.T ) {
384
- reader , err := NewASNReaderFromFile ("testdata/GeoLite2-ASN-Test.mmdb" )
384
+ reader , err := NewASNReaderFromFile ("testdata/maxmind/test-data/ GeoLite2-ASN-Test.mmdb" )
385
385
if err != nil {
386
386
t .Fatal (err )
387
387
}
@@ -410,7 +410,7 @@ func TestASN(t *testing.T) {
410
410
}
411
411
412
412
func TestDBIPCity (t * testing.T ) {
413
- reader , err := NewCityReaderFromFile ("testdata/dbip-city-lite.mmdb" )
413
+ reader , err := NewCityReaderFromFile ("testdata/dbip/dbip -city-lite.mmdb" )
414
414
if err != nil {
415
415
t .Fatal (err )
416
416
}
@@ -421,13 +421,13 @@ func TestDBIPCity(t *testing.T) {
421
421
if record .City .GeoNameID != 0 {
422
422
t .Fatal ()
423
423
}
424
- if record .City .Names ["en" ] != "Boston " {
424
+ if record .City .Names ["en" ] != "Medfield " {
425
425
t .Fatal ()
426
426
}
427
- if record .Location .Latitude != 42.3601 {
427
+ if record .Location .Latitude != 42.1876 {
428
428
t .Fatal ()
429
429
}
430
- if record .Location .Longitude != - 71.0589 {
430
+ if record .Location .Longitude != - 71.3065 {
431
431
t .Fatal ()
432
432
}
433
433
if len (record .Subdivisions ) != 1 {
@@ -439,7 +439,7 @@ func TestDBIPCity(t *testing.T) {
439
439
}
440
440
441
441
func TestDBIPCountry (t * testing.T ) {
442
- reader , err := NewCountryReaderFromFile ("testdata/dbip-country-lite.mmdb" )
442
+ reader , err := NewCountryReaderFromFile ("testdata/dbip/dbip -country-lite.mmdb" )
443
443
if err != nil {
444
444
t .Fatal (err )
445
445
}
@@ -473,7 +473,7 @@ func TestDBIPCountry(t *testing.T) {
473
473
}
474
474
475
475
func TestDBIPASN (t * testing.T ) {
476
- reader , err := NewASNReaderFromFile ("testdata/dbip-asn-lite.mmdb" )
476
+ reader , err := NewASNReaderFromFile ("testdata/dbip/dbip -asn-lite.mmdb" )
477
477
if err != nil {
478
478
t .Fatal (err )
479
479
}
0 commit comments