Skip to content

Commit

Permalink
Indicate other lookups that don't use HTTP.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreisner committed Oct 10, 2023
1 parent e05a5ae commit 92326d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion lib/geocoder/lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def all_services_except_test
# For example, Amazon Location Service uses the AWS gem, not HTTP REST requests, to fetch data.
#
def all_services_with_http_requests
all_services_except_test - [:amazon_location_service, :ip2location_lite]
all_services_except_test - [:amazon_location_service, :maxmind_local, :geoip2, :ip2location_lite]
end

##
Expand Down
4 changes: 0 additions & 4 deletions test/unit/error_handling_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def test_never_raise_response_parse_error
def test_always_raise_timeout_error
Geocoder.configure(:always_raise => [Timeout::Error])
Geocoder::Lookup.all_services_with_http_requests.each do |l|
next if l == :maxmind_local || l == :geoip2 || l == :ip2location_lite # local, does not use cache
lookup = Geocoder::Lookup.get(l)
set_api_key!(l)
assert_raises Timeout::Error do
Expand All @@ -55,7 +54,6 @@ def test_always_raise_timeout_error
def test_always_raise_socket_error
Geocoder.configure(:always_raise => [SocketError])
Geocoder::Lookup.all_services_with_http_requests.each do |l|
next if l == :maxmind_local || l == :geoip2 || l == :ip2location_lite # local, does not use cache
lookup = Geocoder::Lookup.get(l)
set_api_key!(l)
assert_raises SocketError do
Expand All @@ -67,7 +65,6 @@ def test_always_raise_socket_error
def test_always_raise_connection_refused_error
Geocoder.configure(:always_raise => [Errno::ECONNREFUSED])
Geocoder::Lookup.all_services_with_http_requests.each do |l|
next if l == :maxmind_local || l == :geoip2 || l == :ip2location_lite # local, does not use cache
lookup = Geocoder::Lookup.get(l)
set_api_key!(l)
assert_raises Errno::ECONNREFUSED do
Expand All @@ -79,7 +76,6 @@ def test_always_raise_connection_refused_error
def test_always_raise_host_unreachable_error
Geocoder.configure(:always_raise => [Errno::EHOSTUNREACH])
Geocoder::Lookup.all_services_with_http_requests.each do |l|
next if l == :maxmind_local || l == :geoip2 || l == :ip2location_lite # local, does not use cache
lookup = Geocoder::Lookup.get(l)
set_api_key!(l)
assert_raises Errno::EHOSTUNREACH do
Expand Down

0 comments on commit 92326d7

Please sign in to comment.