First tests for postal codes

This commit is contained in:
Carla
2015-07-15 16:29:42 +02:00
parent 8a5a38ece9
commit 7153eaca36
3 changed files with 275 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
#!/bin/sh
#################################################### TESTS GO HERE ####################################################
function test_geocoding_quality_zipcodes_availability() {
#Checks count of available polygon zipcodes
sql "SELECT count(*) FROM available_services where postal_code_polygons is true" should 4
#Checks count of available point zipcodes
sql "SELECT count(*) FROM available_services where postal_code_points is true" should 65
}
function test_geocoding_quality_zipcodes_usa() {
#Checks that zipcode polygons are available
sql "SELECT count(*) FROM available_services where postal_code_polygons is true and adm0_a3 = 'USA'" should 1
#Checks that zipcode points are available
sql "SELECT count(*) FROM available_services where postal_code_points is true and adm0_a3 = 'USA'" should 1
}
function test_geocoding_quality_zipcodes_fra() {
#Checks that zipcode polygons are available
sql "SELECT count(*) FROM available_services where postal_code_polygons is true and adm0_a3 = 'FRA'" should 1
#Checks that zipcode points are available
sql "SELECT count(*) FROM available_services where postal_code_points is true and adm0_a3 = 'FRA'" should 1
}
function test_geocoding_quality_zipcodes_can() {
#Checks that zipcode polygons are available
sql "SELECT count(*) FROM available_services where postal_code_polygons is true and adm0_a3 = 'CAN'" should 1
#Checks that zipcode points are available
sql "SELECT count(*) FROM available_services where postal_code_points is true and adm0_a3 = 'CAN'" should 1
}
function test_geocoding_quality_zipcodes_aus() {
#Checks that zipcode polygons are available
sql "SELECT count(*) FROM available_services where postal_code_polygons is true and adm0_a3 = 'AUS'" should 1
#Checks that zipcode points are available
sql "SELECT count(*) FROM available_services where postal_code_points is true and adm0_a3 = 'AUS'" should 1
}
#################################################### TESTS END HERE ####################################################