adds tests

This commit is contained in:
Andy Eschbacher 2016-05-24 12:02:32 -04:00
parent 94756a2377
commit afb548c75d
2 changed files with 32 additions and 0 deletions

View File

@ -76,3 +76,12 @@ t
obs_getuscensuscategory_polygon
t
(1 row)
obs_getmeasurebyid_cartodb_census_tract
t
(1 row)
obs_getmeasurebyid_cartodb_block_group
t
(1 row)
obs_getmeasurebyid_nulls
t
(1 row)

View File

@ -204,4 +204,27 @@ SELECT cdb_observatory.OBS_GetUSCensusCategory(
cdb_observatory._testarea(), 'Spielman-Singleton Segments: 10 Clusters') = 'Low income, mix of minorities' As OBS_GetUSCensusCategory_polygon;
-- OBS_GetMeasureById tests
SELECT (cdb_observatory.OBS_GetMeasureById(
'36047048500',
'us.census.acs.B01003001',
'us.census.tiger.census_tract',
'2010 - 2014'
) - 3241) / 3241 < 0.0001 As OBS_GetMeasureById_cartodb_census_tract;
SELECT (cdb_observatory.OBS_GetMeasureById(
'360470485002',
'us.census.acs.B01003001',
'us.census.tiger.block_group',
'2010 - 2014'
) - 1900) / 1900 < 0.0001 As OBS_GetMeasureById_cartodb_block_group;
-- geom ref / boundary mismatch
SELECT cdb_observatory.OBS_GetMeasureById(
'36047048500',
'us.census.acs.B01003001',
'us.census.tiger.block_group',
'2010 - 2014'
) IS NULL As OBS_GetMeasureById_nulls;
\i test/fixtures/drop_fixtures.sql