Moving admin0 to common extension dir (WIP)
This commit is contained in:
39
geocoder/extension/expected/cdb_geocoder_admin0_test.out
Normal file
39
geocoder/extension/expected/cdb_geocoder_admin0_test.out
Normal file
@@ -0,0 +1,39 @@
|
||||
CREATE EXTENSION postgis;
|
||||
CREATE EXTENSION schema_triggers;
|
||||
CREATE EXTENSION plpythonu;
|
||||
CREATE EXTENSION cartodb;
|
||||
CREATE EXTENSION cdb_geocoder_admin0;
|
||||
-- Check that the synonym function is callable, should return NULL
|
||||
SELECT (admin0_synonym_lookup(Array['United States', 'ESP'])).*;
|
||||
q | adm0_a3
|
||||
---------------+---------
|
||||
United States |
|
||||
ESP |
|
||||
(2 rows)
|
||||
|
||||
-- Check that the geocoding function is callable, should return success = false
|
||||
SELECT (geocode_admin0_polygons(Array['Spain', 'USA', ''])).*;
|
||||
q | geom | success
|
||||
-------+------+---------
|
||||
| | f
|
||||
Spain | | f
|
||||
USA | | f
|
||||
(3 rows)
|
||||
|
||||
-- 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 synonyms
|
||||
COPY admin0_synonyms (name, rank, created_at, updated_at, the_geom, the_geom_webmercator, cartodb_id, adm0_a3, name_) FROM stdin;
|
||||
-- Check that the synonym function is callable, should return their iso codes
|
||||
SELECT (admin0_synonym_lookup(Array['United States', 'ESP'])).*;
|
||||
q | adm0_a3
|
||||
---------------+---------
|
||||
ESP | ESP
|
||||
United States | USA
|
||||
(2 rows)
|
||||
|
||||
Reference in New Issue
Block a user