From 30e480e545813654f07e5056961000c1389bb630 Mon Sep 17 00:00:00 2001 From: antoniocarlon Date: Thu, 6 Sep 2018 12:46:12 +0200 Subject: [PATCH] Fixed m04r tests --- .../test/expected/60_postalcodes_test.out | 36 +++++++++---------- .../extension/test/expected/70_ips_test.out | 6 ++-- .../test/expected/85_isodistance_test.out | 2 +- .../test/expected/90_isochrone_test.out | 2 +- .../expected/95_route_between_points_test.out | 4 +-- .../test/sql/60_postalcodes_test.sql | 28 +++++++-------- server/extension/test/sql/70_ips_test.sql | 6 ++-- .../test/sql/85_isodistance_test.sql | 2 +- .../extension/test/sql/90_isochrone_test.sql | 2 +- .../test/sql/95_route_between_points_test.sql | 4 +-- 10 files changed, 46 insertions(+), 46 deletions(-) diff --git a/server/extension/test/expected/60_postalcodes_test.out b/server/extension/test/expected/60_postalcodes_test.out index b2a5c91..f671d79 100644 --- a/server/extension/test/expected/60_postalcodes_test.out +++ b/server/extension/test/expected/60_postalcodes_test.out @@ -6,7 +6,7 @@ DELETE FROM available_services; DELETE FROM admin0_synonyms; -- Check that the public function is callable, even with no data -- It should return NULL -SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', '03204'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', 'test_app', '03204'); cdb_geocode_postalcode_point ------------------------------ @@ -42,25 +42,25 @@ INSERT INTO admin0_synonyms (adm0_a3, name, name_, rank) VALUES ( 3 ); -- This should return the polygon inserted above -SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', '03204'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', 'test_app', '03204'); cdb_geocode_postalcode_point ---------------------------------------------------- 0101000020E61000000000000000E040408036B47414764840 (1 row) -SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', '03204', 'spain'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', 'test_app', '03204', 'spain'); cdb_geocode_postalcode_point ---------------------------------------------------- 0101000020E61000000000000000E040408036B47414764840 (1 row) -SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon('test_user', 'test_org', '03204'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon('test_user', 'test_org', 'test_app', '03204'); cdb_geocode_postalcode_polygon -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0106000020E610000001000000010300000001000000040000000000000000E000C01F383D7839B740400000000000E000C0AA3C0EDE220F3B4000000000004812404FB7FCCD04893D400000000000E000C01F383D7839B74040 (1 row) -SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon('test_user', 'test_org', '03204', 'spain'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon('test_user', 'test_org', 'test_app', '03204', 'spain'); cdb_geocode_postalcode_polygon -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0106000020E610000001000000010300000001000000040000000000000000E000C01F383D7839B740400000000000E000C0AA3C0EDE220F3B4000000000004812404FB7FCCD04893D400000000000E000C01F383D7839B74040 @@ -78,7 +78,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_geocode_postalcode_point' - AND oidvectortypes(p.proargtypes) = 'text, text, text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, text'); exists -------- t @@ -89,18 +89,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_geocode_postalcode_point' - AND oidvectortypes(p.proargtypes) = 'text, text, text, text'); - exists --------- - t -(1 row) - -SELECT exists(SELECT * - FROM pg_proc p - INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) - WHERE ns.nspname = 'cdb_dataservices_server' - AND proname = 'cdb_geocode_postalcode_polygon' - AND oidvectortypes(p.proargtypes) = 'text, text, text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, text, text'); exists -------- t @@ -117,6 +106,17 @@ SELECT exists(SELECT * t (1 row) +SELECT exists(SELECT * + FROM pg_proc p + INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) + WHERE ns.nspname = 'cdb_dataservices_server' + AND proname = 'cdb_geocode_postalcode_polygon' + AND oidvectortypes(p.proargtypes) = 'text, text, text, text, text'); + exists +-------- + t +(1 row) + SELECT exists(SELECT * FROM pg_proc p INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) diff --git a/server/extension/test/expected/70_ips_test.out b/server/extension/test/expected/70_ips_test.out index 48012f7..f5ea404 100644 --- a/server/extension/test/expected/70_ips_test.out +++ b/server/extension/test/expected/70_ips_test.out @@ -1,6 +1,6 @@ -- Check that the public function is callable, even with no data -- It should return NULL -SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', '0.0.0.0'); +SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', 'test_appname', '0.0.0.0'); cdb_geocode_ipaddress_point ----------------------------- @@ -9,7 +9,7 @@ SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_or -- Insert dummy data into ip_address_locations INSERT INTO ip_address_locations VALUES ('::ffff:0.0.0.0'::inet, (ST_SetSRID(ST_MakePoint('40.40', '3.71'), 4326))); -- This should return the polygon inserted above -SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', '0.0.0.0'); +SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', 'test_appname', '0.0.0.0'); cdb_geocode_ipaddress_point ---------------------------------------------------- 0101000020E61000003333333333334440AE47E17A14AE0D40 @@ -21,7 +21,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_geocode_ipaddress_point' - AND oidvectortypes(p.proargtypes) = 'text, text, text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, text'); exists -------- t diff --git a/server/extension/test/expected/85_isodistance_test.out b/server/extension/test/expected/85_isodistance_test.out index 5705284..2ecbb88 100644 --- a/server/extension/test/expected/85_isodistance_test.out +++ b/server/extension/test/expected/85_isodistance_test.out @@ -4,7 +4,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_isodistance' - AND oidvectortypes(p.proargtypes) = 'text, text, geometry, text, integer[], text[]'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, geometry, text, integer[], text[]'); exists -------- t diff --git a/server/extension/test/expected/90_isochrone_test.out b/server/extension/test/expected/90_isochrone_test.out index 7ee0f04..193b59f 100644 --- a/server/extension/test/expected/90_isochrone_test.out +++ b/server/extension/test/expected/90_isochrone_test.out @@ -4,7 +4,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_isochrone' - AND oidvectortypes(p.proargtypes) = 'text, text, geometry, text, integer[], text[]'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, geometry, text, integer[], text[]'); exists -------- t diff --git a/server/extension/test/expected/95_route_between_points_test.out b/server/extension/test/expected/95_route_between_points_test.out index 176059f..cfc8585 100644 --- a/server/extension/test/expected/95_route_between_points_test.out +++ b/server/extension/test/expected/95_route_between_points_test.out @@ -4,7 +4,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_route_point_to_point' - AND oidvectortypes(p.proargtypes) = 'text, text, geometry, geometry, text, text[], text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, geometry, geometry, text, text[], text'); exists -------- t @@ -16,7 +16,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_route_with_waypoints' - AND oidvectortypes(p.proargtypes) = 'text, text, geometry[], text, text[], text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, geometry[], text, text[], text'); exists -------- t diff --git a/server/extension/test/sql/60_postalcodes_test.sql b/server/extension/test/sql/60_postalcodes_test.sql index 55d1c85..eea2c8f 100644 --- a/server/extension/test/sql/60_postalcodes_test.sql +++ b/server/extension/test/sql/60_postalcodes_test.sql @@ -7,7 +7,7 @@ DELETE FROM admin0_synonyms; -- Check that the public function is callable, even with no data -- It should return NULL -SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', '03204'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', 'test_app', '03204'); -- Insert dummy data into ip_address_locations INSERT INTO global_postal_code_points (the_geom, iso3, postal_code, postal_code_num) VALUES ( @@ -44,13 +44,13 @@ INSERT INTO admin0_synonyms (adm0_a3, name, name_, rank) VALUES ( ); -- This should return the polygon inserted above -SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', '03204'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', 'test_app', '03204'); -SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', '03204', 'spain'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', 'test_app', '03204', 'spain'); -SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon('test_user', 'test_org', '03204'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon('test_user', 'test_org', 'test_app', '03204'); -SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon('test_user', 'test_org', '03204', 'spain'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_polygon('test_user', 'test_org', 'test_app', '03204', 'spain'); -- Clean dbs DELETE FROM global_postal_code_points; @@ -65,21 +65,14 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_geocode_postalcode_point' - AND oidvectortypes(p.proargtypes) = 'text, text, text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, text'); SELECT exists(SELECT * FROM pg_proc p INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_geocode_postalcode_point' - AND oidvectortypes(p.proargtypes) = 'text, text, text, text'); - -SELECT exists(SELECT * - FROM pg_proc p - INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) - WHERE ns.nspname = 'cdb_dataservices_server' - AND proname = 'cdb_geocode_postalcode_polygon' - AND oidvectortypes(p.proargtypes) = 'text, text, text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, text, text'); SELECT exists(SELECT * FROM pg_proc p @@ -88,6 +81,13 @@ SELECT exists(SELECT * AND proname = 'cdb_geocode_postalcode_polygon' AND oidvectortypes(p.proargtypes) = 'text, text, text, text'); +SELECT exists(SELECT * + FROM pg_proc p + INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) + WHERE ns.nspname = 'cdb_dataservices_server' + AND proname = 'cdb_geocode_postalcode_polygon' + AND oidvectortypes(p.proargtypes) = 'text, text, text, text, text'); + SELECT exists(SELECT * FROM pg_proc p INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) diff --git a/server/extension/test/sql/70_ips_test.sql b/server/extension/test/sql/70_ips_test.sql index 6111bd0..79bea61 100644 --- a/server/extension/test/sql/70_ips_test.sql +++ b/server/extension/test/sql/70_ips_test.sql @@ -1,12 +1,12 @@ -- Check that the public function is callable, even with no data -- It should return NULL -SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', '0.0.0.0'); +SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', 'test_appname', '0.0.0.0'); -- Insert dummy data into ip_address_locations INSERT INTO ip_address_locations VALUES ('::ffff:0.0.0.0'::inet, (ST_SetSRID(ST_MakePoint('40.40', '3.71'), 4326))); -- This should return the polygon inserted above -SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', '0.0.0.0'); +SELECT cdb_dataservices_server.cdb_geocode_ipaddress_point('test_user', 'test_orgname', 'test_appname', '0.0.0.0'); -- Check for namedplaces signatures (point and polygon) SELECT exists(SELECT * @@ -14,7 +14,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_geocode_ipaddress_point' - AND oidvectortypes(p.proargtypes) = 'text, text, text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, text'); SELECT exists(SELECT * FROM pg_proc p diff --git a/server/extension/test/sql/85_isodistance_test.sql b/server/extension/test/sql/85_isodistance_test.sql index f66b68a..4f5c37f 100644 --- a/server/extension/test/sql/85_isodistance_test.sql +++ b/server/extension/test/sql/85_isodistance_test.sql @@ -4,4 +4,4 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_isodistance' - AND oidvectortypes(p.proargtypes) = 'text, text, geometry, text, integer[], text[]'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, geometry, text, integer[], text[]'); diff --git a/server/extension/test/sql/90_isochrone_test.sql b/server/extension/test/sql/90_isochrone_test.sql index 113fb28..60819bc 100644 --- a/server/extension/test/sql/90_isochrone_test.sql +++ b/server/extension/test/sql/90_isochrone_test.sql @@ -4,4 +4,4 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_isochrone' - AND oidvectortypes(p.proargtypes) = 'text, text, geometry, text, integer[], text[]'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, geometry, text, integer[], text[]'); diff --git a/server/extension/test/sql/95_route_between_points_test.sql b/server/extension/test/sql/95_route_between_points_test.sql index 4acc15d..21fe257 100644 --- a/server/extension/test/sql/95_route_between_points_test.sql +++ b/server/extension/test/sql/95_route_between_points_test.sql @@ -4,7 +4,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_route_point_to_point' - AND oidvectortypes(p.proargtypes) = 'text, text, geometry, geometry, text, text[], text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, geometry, geometry, text, text[], text'); -- Check for routing waypoint route signatures SELECT exists(SELECT * @@ -12,4 +12,4 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_route_with_waypoints' - AND oidvectortypes(p.proargtypes) = 'text, text, geometry[], text, text[], text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, geometry[], text, text[], text');