Tests

class omgeo.tests.tests.GeocoderProcessorTest(methodName='runTest')[source]

Tests using various pre- and post-processors.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_postpro_GroupBy()[source]

Test GroupBy postprocessor.

test_pro_CancelIfPOBox()[source]

Test CancelIfPOBox preprocessor.

test_pro_CancelIfRegexInAttr()[source]

Test CancelIfRegexInAttr preprocessor.

test_pro_CancelIfRegexInAttr_case_sensitive()[source]

Test CancelIfRegexInAttr preprocessor using case-sensitive option.

test_pro_SnapPoints()[source]

Take two candidates within 50 metres and eliminate one.

test_pro_country_CountryPreProcessor()[source]

Test CountryPreProcessor

test_pro_country_RequireCountry()[source]

Test RequireCountry preprocessor.

test_pro_filter_AttrExclude_exact()[source]

Test AttrExclude with exact_match=True.

test_pro_filter_AttrExclude_inexact()[source]

Test AttrExclude with exact_match=False.

test_pro_filter_AttrFilter_exact()[source]

Test AttrFilter postprocessor.

test_pro_filter_AttrFilter_inexact()[source]

Test AttrFilter postprocessor with exact_match=False.

test_pro_parsing_ParseSingleLine()[source]

Test ParseSingleLine preprocessor using single-line UK address.

test_pro_rename_AttrRename_exact()[source]

Test AttrRename postprocessor using exact search string.

test_pro_rename_AttrRename_inexact()[source]

Test AttrRename postprocessor using partial search string.

test_pro_scoring_ScoreSorter()[source]

Test ScoreSorter postprocessor.

test_pro_scoring_ScoreSorter_asc()[source]

Test ScoreSorter postprocessor with reverse=False.

test_pro_scoring_UseHighScoreIfAtLeast()[source]

Test UseHighScoreIfAtLeast postprocessor.

test_pro_sort_AttrReverseSorter()[source]

Test AttrReverseSorter postprocessor.

test_pro_sort_AttrSorter()[source]

Test AttrSorter postprocessor.

test_pro_streetnumber_ReplaceRangeWithNumber()[source]

Test ReplaceRangeWithNumber preprocessor.

class omgeo.tests.tests.GeocoderTest(methodName='runTest')[source]

Tests using various geocoding APIs. Requires internet connection.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_EsriWGS_address_components()[source]

Make sure EsriWGS returns address components

test_census_address_components()[source]

Make sure census geocoder returns address components

test_geocode_bing(**kwargs)[source]

Test Azavea’s address using Bing geocoder

test_geocode_census()[source]

Test Azavea’s address using US Census geocoder.

test_geocode_dupepicker()[source]

Check that ‘340 12th St returns results’

test_geocode_esri_wgs_340_12th_bounded()[source]

Trying to geocode 340 12th St, Philadelphia PA would normally return results for both 340 N 12th St and 340 S 12th St. Using a bounding box around Callowhill, we should only get the former.

test_geocode_esri_wgs_auth(**kwargs)[source]

Test that using authentication with the ESRI WGS geocoder is working

test_geocode_esri_wgs_multipart()[source]

Check that geocoding multipart address returns one result.

test_geocode_esri_wgs_senado_mx()[source]

Attempt to geocode Paseo de la Reforma 135, Tabacalera, Cuauhtémoc, Distrito Federal, 06030.

test_geocode_esri_wgs_zip_plus_4()[source]

Check that geocoding 19127-1112 returns one result.

test_geocode_karori(**kwargs)[source]

Check that ‘102 Karori Road Karori Wellington’ returns an address with the correct house number and postcode.

test_geocode_mapquest(**kwargs)[source]

Test Azavea’s address using MapQuest geocoder.

test_geocode_mapquest_ssl(**kwargs)[source]

Test Azavea’s address using secure MapQuest geocoder.

test_geocode_nom(**kwargs)[source]

Test 1200 Callowhill Street using Nominatim geocoder. Also check to make sure coordinate values are floats and not some other data type.

test_geocode_pelias(**kwargs)[source]

Test Azavea’s address using Pelias geocoder

test_geocode_snap_points_2(**kwargs)[source]

Bing geocoder expected to return the same place twice – one with city as Alpha, and one with city as Phillipsburg. This test checks that only one is picked.

test_geocode_structured_esri_wgs_senado_mx()[source]

Attempt to geocode Paseo de la Reforma 135, Tabacalera, Cuauhtémoc, Distrito Federal, 06030 using a structured query to EsriWGS.

test_google_geocode_multipart(**kwargs)[source]

Check that geocoding multipart address returns one result.

class omgeo.tests.tests.OmgeoTestCase(methodName='runTest')[source]

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

assertEqualCI_(output, expected, strip_commas=False)[source]

Case-insensitive assertEqual with built-in error message

assertEqual_(output, expected)[source]

assertEqual with built-in error message