From 20ec7ef25a2de1a07b54755fbc5fc605d77b8de1 Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Mon, 25 Apr 2016 10:18:18 -0400 Subject: [PATCH] whitespace fix --- .../expected/40_observatory_utility_test.out | 60 +++++++++++++++---- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/src/pg/test/expected/40_observatory_utility_test.out b/src/pg/test/expected/40_observatory_utility_test.out index 5cc88e7..f24f5f3 100644 --- a/src/pg/test/expected/40_observatory_utility_test.out +++ b/src/pg/test/expected/40_observatory_utility_test.out @@ -46,14 +46,46 @@ SELECT (1 row) -test_get_obs_column_with_geoid_and_census_1 | test_get_obs_column_with_geoid_and_census_2 | test_get_obs_column_with_geoid_and_census_3 ----------------------------------------------+---------------------------------------------+--------------------------------------------- -t | t | t +-- future test: give back nulls when geometry doesn't intersect +-- SELECT +-- cdb_observatory._OBS_GeomTable( +-- CDB_LatLng(0,0), -- should give back null since it's in the ocean? +-- '"us.census.tiger".census_tract' +-- ); +-- OBS_GetColumnData +-- should give back: +-- colname | tablename | aggregate +-- -----------|-----------------|----------- +-- geoid | obs_{hex table} | null +-- total_pop | obs_{hex table} | sum +WITH result as ( +SELECT + array_agg(a) expected from cdb_observatory._OBS_GetColumnData( + '"us.census.tiger".census_tract', + Array['"us.census.tiger".census_tract_geoid', '"us.census.acs".B01001001'], + '2009 - 2013') a +) +select (expected)[1]::text = '{"colname":"geoid","tablename":"obs_d34555209878e8c4b37cf0b2b3d072ff129ec470","aggregate":null,"name":"US Census Tract Geoids","type":"Text","description":""}' as test_get_obs_column_with_geoid_and_census_1, + (expected)[2]::text = '{"colname":"geoid","tablename":"obs_ab038198aaab3f3cb055758638ee4de28ad70146","aggregate":null,"name":"US Census Tract Geoids","type":"Text","description":""}' as test_get_obs_column_with_geoid_and_census_2 +from result; + test_get_obs_column_with_geoid_and_census_1 | test_get_obs_column_with_geoid_and_census_2 +---------------------------------------------+--------------------------------------------- + t | t (1 row) -obs_getcolumndatajson_missing_measure ---------------------------------------- -t +-- should be null-valued +WITH result as ( +SELECT + array_agg(a) expected from cdb_observatory._OBS_GetColumnData( + '"us.census.tiger".census_tract', + Array['"us.census.tiger".baloney'], + '2009 - 2013') a +) +select expected is null as OBS_GetColumnData_missing_measure +from result; + obs_getcolumndata_missing_measure +----------------------------------- + t (1 row) -- OBS_LookupCensusHuman @@ -98,11 +130,17 @@ SELECT SELECT vals[1] As mandarin_orange (1 row) --- should give back a normalized name - SELECT cdb_observatory._OBS_NormalizeMeasureName('test 343 %% 2 qqq }}{{}}'); -_obs_normalizemeasurename ---------------------------- -test_343_2_qqq +SELECT cdb_observatory._OBS_GetRelatedColumn( + Array[ + '"es.ine".pop_0_4', + '"us.census.acs".B01001001', + '"us.census.acs".B01001002' + ], + 'denominator' + ); + _obs_getrelatedcolumn +------------------------------------------------------------- + {"\"es.ine\".total_pop",NULL,"\"us.census.acs\".B01001001"} (1 row) \i test/sql/drop_fixtures.sql