@@ -30,74 +30,94 @@ end_per_suite(_Config) ->
3030details_test (Config ) ->
3131 Token = proplists :get_value (token , Config ),
3232 {ok , IpInfo } = ipinfo :create (Token ),
33- {ok , #{
34- ip := <<" 8.8.8.8" >>,
35- loc := <<" 37.4056,-122.0775" >>,
36- hostname := <<" dns.google" >>,
37- city := <<" Mountain View" >>,
38- region := <<" California" >>,
39- country := <<" US" >>,
40- org := <<" AS15169 Google LLC" >>,
41- postal := <<" 94043" >>,
42- timezone := <<" America/Los_Angeles" >>,
43- country_name := <<" United States" >>,
44- latitude := <<" 37.4056" >>,
45- longitude := <<" -122.0775" >>,
46- is_eu := false ,
47- country_flag := #{
48- <<" emoji" >> := <<240 ,159 ,135 ,186 ,240 ,159 ,135 ,184 >>,
49- <<" unicode" >> := <<" U+1F1FA U+1F1F8" >>
50- },
51- country_currency := #{
52- <<" code" >> := <<" USD" >>,
53- <<" symbol" >> := <<" $" >>
54- },
55- continent := #{
56- <<" code" >> := <<" NA" >>,
57- <<" name" >> := <<" North America" >>
58- },
59- country_flag_url := <<" https:/cdn.ipinfo.io/static/images/countries-flags/US.svg" >>,
60- is_anonymous := false ,
61- <<" abuse" >> := #{
62- name := <<" Abuse" >>,
63- address := <<" US, CA, Mountain View, 1600 Amphitheatre Parkway, 94043" >>,
64- country := <<" US" >>,
65- email := <<" network-abuse@google.com" >>,
66- <<" network" >> := <<" 8.8.8.0/24" >>,
67- <<" phone" >> := <<" +1-650-253-0000" >>
68- },
69- <<" asn" >> := #{
70- name := <<" Google LLC" >>,
71- type := <<" hosting" >>,
72- domain := <<" google.com" >>,
73- <<" asn" >> := <<" AS15169" >>,
74- <<" route" >> := <<" 8.8.8.0/24" >>
75- },
76- <<" company" >> := #{
77- name := <<" Google LLC" >>,
78- type := <<" hosting" >>,
79- domain := <<" google.com" >>
80- },
81- <<" domains" >> := #{
82- total := 15669 ,ip := <<" 8.8.8.8" >>,
83- <<" domains" >> := [
84- <<" hdchina.org" >>,
85- <<" musicool.cn" >>,
86- <<" ztgg.org" >>,
87- <<" itempurl.com" >>,
88- <<" authrock.com" >>
89- ]
90- },
91- <<" is_anycast" >> := true ,
92- <<" is_hosting" >> := true ,
93- <<" is_mobile" >> := false ,
94- <<" is_satellite" >> := false ,
95- <<" privacy" >> := #{
96- service := <<>>,
97- proxy := false ,
98- relay := false ,
99- <<" hosting" >> := true ,
100- <<" tor" >> := false ,
101- <<" vpn" >> := false
102- }
103- }} = ipinfo :details (IpInfo , <<" 8.8.8.8" >>).
33+ {ok , Details }= ipinfo :details (IpInfo , <<" 8.8.8.8" >>),
34+ ? assertEqual (<<" Mountain View" >>, maps :get (city , Details )).
35+
36+ % continent =>
37+ % #{<<"code">> => <<"NA">>,
38+ % <<"name">> => <<"North America">>},
39+ % country => <<"US">>,
40+ % country_currency =>
41+ % #{<<"code">> => <<"USD">>,<<"symbol">> => <<"$">>},
42+ % country_flag =>
43+ % #{<<"emoji">> => <<240,159,135,186,240,159,135,184>>,
44+ % <<"unicode">> => <<"U+1F1FA U+1F1F8">>},
45+ % country_flag_url =>
46+ % <<"https:/cdn.ipinfo.io/static/images/countries-flags/US.svg">>,
47+ % country_name => <<"United States">>,
48+ % hostname => <<"dns.google">>,ip => <<"8.8.8.8">>,
49+ % is_anonymous => false,is_eu => false,
50+ % latitude => <<"38.0088">>,loc => <<"38.0088,-122.1175">>,
51+ % longitude => <<"-122.1175">>,org => <<"AS15169 Google LLC">>,
52+ % postal => <<"94043">>,region => <<"California">>,
53+ % timezone => <<"America/Los_Angeles">>,
54+ % <<"abuse">> =>
55+ % #{address =>
56+ % <<"US, CA, Mountain View, 1600 Amphitheatre Parkway, 94043">>,
57+ % country => <<"US">>,
58+ % email => <<"network-abuse@google.com">>,
59+ % name => <<"Abuse">>,<<"network">> => <<"8.8.8.0/24">>,
60+ % <<"phone">> => <<"+1-650-253-0000">>},
61+ % <<"asn">> =>
62+ % #{domain => <<"google.com">>,name => <<"Google LLC">>,
63+ % type => <<"hosting">>,<<"asn">> => <<"AS15169">>,
64+ % <<"route">> => <<"8.8.8.0/24">>},
65+ % <<"company">> =>
66+ % #{domain => <<"google.com">>,name => <<"Google LLC">>,
67+ % type => <<"hosting">>},
68+ % <<"domains">> =>
69+ % #{ip => <<"8.8.8.8">>,total => 15669,
70+ % <<"domains">> =>
71+ % [<<"hdchina.org">>,<<"musicool.cn">>,
72+ % <<"ztgg.org">>,<<"itempurl.com">>,
73+ % <<"authrock.com">>]},
74+ % <<"is_anycast">> => true,<<"is_hosting">> => true,
75+ % <<"is_mobile">> => false,<<"is_satellite">> => false,
76+ % <<"privacy">> =>
77+ % #{proxy => false,relay => false,service => <<>>,
78+ % <<"hosting">> => true,<<"tor">> => false,
79+ % <<"vpn">> => false}}}}, continent =>
80+ % #{<<"code">> => <<"NA">>,
81+ % <<"name">> => <<"North America">>},
82+ % country => <<"US">>,
83+ % country_currency =>
84+ % #{<<"code">> => <<"USD">>,<<"symbol">> => <<"$">>},
85+ % country_flag =>
86+ % #{<<"emoji">> => <<240,159,135,186,240,159,135,184>>,
87+ % <<"unicode">> => <<"U+1F1FA U+1F1F8">>},
88+ % country_flag_url =>
89+ % <<"https:/cdn.ipinfo.io/static/images/countries-flags/US.svg">>,
90+ % country_name => <<"United States">>,
91+ % hostname => <<"dns.google">>,ip => <<"8.8.8.8">>,
92+ % is_anonymous => false,is_eu => false,
93+ % latitude => <<"38.0088">>,loc => <<"38.0088,-122.1175">>,
94+ % longitude => <<"-122.1175">>,org => <<"AS15169 Google LLC">>,
95+ % postal => <<"94043">>,region => <<"California">>,
96+ % timezone => <<"America/Los_Angeles">>,
97+ % <<"abuse">> =>
98+ % #{address =>
99+ % <<"US, CA, Mountain View, 1600 Amphitheatre Parkway, 94043">>,
100+ % country => <<"US">>,
101+ % email => <<"network-abuse@google.com">>,
102+ % name => <<"Abuse">>,<<"network">> => <<"8.8.8.0/24">>,
103+ % <<"phone">> => <<"+1-650-253-0000">>},
104+ % <<"asn">> =>
105+ % #{domain => <<"google.com">>,name => <<"Google LLC">>,
106+ % type => <<"hosting">>,<<"asn">> => <<"AS15169">>,
107+ % <<"route">> => <<"8.8.8.0/24">>},
108+ % <<"company">> =>
109+ % #{domain => <<"google.com">>,name => <<"Google LLC">>,
110+ % type => <<"hosting">>},
111+ % <<"domains">> =>
112+ % #{ip => <<"8.8.8.8">>,total => 15669,
113+ % <<"domains">> =>
114+ % [<<"hdchina.org">>,<<"musicool.cn">>,
115+ % <<"ztgg.org">>,<<"itempurl.com">>,
116+ % <<"authrock.com">>]},
117+ % <<"is_anycast">> => true,<<"is_hosting">> => true,
118+ % <<"is_mobile">> => false,<<"is_satellite">> => false,
119+ % <<"privacy">> =>
120+ % #{proxy => false,relay => false,service => <<>>,
121+ % <<"hosting">> => true,<<"tor">> => false,
122+ % <<"vpn">> => false}}}},
123+
0 commit comments