Skip to content

Commit fa2f158

Browse files
committed
Switch test_lookup_ip6 to use more stable IPv6 address
1 parent 15dcd75 commit fa2f158

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

test/ipinfo_test.rb

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,37 @@
44

55
class IPinfoTest < Minitest::Test
66
TEST_IPV4 = '8.8.8.8'
7-
TEST_IPV6 = '2601:9:7680:363:75df:f491:6f85:352f'
7+
TEST_IPV6 = '2001:240:2a54:3900::'
88

99
def assert_ip6(resp)
1010
assert_equal(resp.ip, TEST_IPV6)
1111
assert_equal(resp.ip_address, IPAddr.new(TEST_IPV6))
12-
assert_equal(resp.city, 'Mount Laurel')
13-
assert_equal(resp.region, 'New Jersey')
14-
assert_equal(resp.country, 'US')
15-
assert_equal(resp.country_name, 'United States')
12+
assert_equal(resp.city, 'Hiroshima')
13+
assert_equal(resp.region, 'Hiroshima')
14+
assert_equal(resp.country, 'JP')
15+
assert_equal(resp.country_name, 'Japan')
1616
assert_equal(resp.is_eu, false)
17-
assert_equal(resp.loc, '39.9340,-74.8910')
18-
assert_equal(resp.latitude, '39.9340')
19-
assert_equal(resp.longitude, '-74.8910')
20-
assert_equal(resp.postal, '08054')
21-
assert_equal(resp.timezone, 'America/New_York')
22-
assert_equal(resp.country_flag_url, 'https://cdn.ipinfo.io/static/images/countries-flags/US.svg')
17+
assert_equal(resp.loc, '34.4000,132.4500')
18+
assert_equal(resp.latitude, '34.4000')
19+
assert_equal(resp.longitude, '132.4500')
20+
assert_equal(resp.postal, '730-0011')
21+
assert_equal(resp.timezone, 'Asia/Tokyo')
22+
assert_equal(resp.country_flag_url, 'https://cdn.ipinfo.io/static/images/countries-flags/JP.svg')
2323
assert_equal(
2424
resp.asn,
2525
{
26-
"asn": 'AS7922',
27-
"name": 'Comcast Cable Communications, LLC',
28-
"domain": 'comcast.com',
29-
"route": '2601::/20',
26+
"asn": 'AS2497',
27+
"name": 'Internet Initiative Japan Inc.',
28+
"domain": 'iij.ad.jp',
29+
"route": '2001:240::/32',
3030
"type": 'isp'
3131
}
3232
)
3333
assert_equal(
3434
resp.company,
3535
{
36-
"name": 'Comcast Cable Communications, LLC',
37-
"domain": 'comcast.com',
36+
"name": 'Internet Initiative Japan Inc.',
37+
"domain": 'iij.ad.jp',
3838
"type": 'isp'
3939
}
4040
)
@@ -52,13 +52,12 @@ def assert_ip6(resp)
5252
assert_equal(
5353
resp.abuse,
5454
{
55-
"address": 'US, NJ, Mount Laurel, ' \
56-
'1800 Bishops Gate Blvd, 08054',
57-
"country": 'US',
58-
"email": '[email protected]',
59-
"name": 'Network Abuse and Policy Observance',
60-
"network": '2601:9::/32',
61-
"phone": '+1-888-565-4329'
55+
"address": 'Brisbane, Australia',
56+
"country": 'AU',
57+
"email": '[email protected]',
58+
"name": 'ABUSE APNICAP',
59+
"network": '2001:200::/23',
60+
"phone": '+000000000'
6261
}
6362
)
6463
assert_equal(

0 commit comments

Comments
 (0)