diff --git a/geocoder/ip-addresses/extension/README.md b/geocoder/ip-addresses/extension/README.md index b814d22..908d8a3 100644 --- a/geocoder/ip-addresses/extension/README.md +++ b/geocoder/ip-addresses/extension/README.md @@ -24,7 +24,7 @@ PGUSER=postgres make installcheck ## Install onto a user's database ``` -psql -U development_cartodb_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f cartodb_dev_user_fe3b850a-01c0-48f9-8a26-a82f09e9b53f_db +psql -U cartodb_dev_user_367c0edc-b2ad-4bab-ad43-3d58a6179a93_db cartodb_dev_user_367c0edc-b2ad-4bab-ad43-3d58a6179a93_db ``` and then: diff --git a/geocoder/ip-addresses/extension/expected/cdb_geocoder_ipaddr_test.out b/geocoder/ip-addresses/extension/expected/cdb_geocoder_ipaddr_test.out new file mode 100644 index 0000000..1834323 --- /dev/null +++ b/geocoder/ip-addresses/extension/expected/cdb_geocoder_ipaddr_test.out @@ -0,0 +1,27 @@ +CREATE EXTENSION postgis; +CREATE EXTENSION schema_triggers; +CREATE EXTENSION plpythonu; +CREATE EXTENSION cartodb; +CREATE EXTENSION cdb_geocoder_ipaddr; +-- Check that the geocoding function is callable, should return success = false +SELECT (geocode_ip(Array['100.0.24.0'])).*; + q | geom | success +------------+------+--------- + 100.0.24.0 | | f +(1 row) + +-- Mock the varnish invalidation function +CREATE OR REPLACE FUNCTION public.cdb_invalidate_varnish(table_name text) RETURNS void AS $$ +BEGIN + RETURN; +END +$$ +LANGUAGE plpgsql; +-- Add a few IP sources +COPY ip_address_locations (network_start_ip, the_geom, cartodb_id, created_at, updated_at, the_geom_webmercator) FROM stdin; +-- Check that the geocoding function is callable, should return success = true +SELECT (geocode_ip(Array['2.235.35.0'])).*; + q | geom | success +------------+----------------------------------------------------+--------- + 2.235.35.0 | 0101000020E610000072F90FE9B7CF22405DFE43FAEDC34640 | t +(1 row)