def test_geocode_with_default_geocoder(self): """Test geocoding with default geocoder""" self._select_geocoder() geocoder = get_geocoder() address = "370 17th St, Denver" results = list(geocoder.geocode(address, exactly_one=False)) self.assertTrue(len(results) > 0) place, (lat, lng) = results[0] self.assertEqual(lat, 39.7434926) self.assertEqual(lng, -104.9886368)
def test_geocode_with_default_geocoder(self): """Test geocoding with default geocoder""" self._select_geocoder() geocoder = get_geocoder() address = "370 17th St, Denver" results = list(geocoder.geocode(address, exactly_one=False)) self.assertTrue(len(results) > 0) place, (lat, lng) = results[0] self.assertEqual(lat, 39.7434926) self.assertEqual(lng, -104.9886368)
def _geocode(self, address): point = None geocoder = get_geocoder() # There might be more than one matching location. For now, just # assume the first one. results = list(geocoder.geocode(address, exactly_one=False)) if results: place, (lat, lng) = results[0] point = (lat, lng) return point
def _geocode(self, address): point = None geocoder = get_geocoder() # There might be more than one matching location. For now, just # assume the first one. results = list(geocoder.geocode(address, exactly_one=False)) if results: place, (lat, lng) = results[0] point = (lat, lng) return point
def test_get_geocoder(self): """Test that the get_geocoder function returns a geocoder""" geocoder = get_geocoder() self.assertTrue(isinstance(geocoder, Geocoder))
def get_geocoder(self): return get_geocoder()
def test_get_geocoder(self): """Test that the get_geocoder function returns a geocoder""" geocoder = get_geocoder() self.assertTrue(isinstance(geocoder, Geocoder))
def get_geocoder(self): return get_geocoder()