denverfoundation / storybase

The code behind Floodlight
http://floodlightproject.org
MIT License
11 stars 7 forks source link

Geocoding errors #277

Closed ghing closed 12 years ago

ghing commented 12 years ago

A bunch of the geocoding tests started failing today:

======================================================================
ERROR: test_geocode_address_yahoo (storybase_geo.tests.GeocoderResourceTest)
Test geocoding a street address with Yahoo geocoder
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 127, in test_geocode_address_yahoo
    self.assertApxEqual(results[0].lat, 39.7434926)
IndexError: list index out of range

======================================================================
ERROR: test_geocode_city_state_yahoo (storybase_geo.tests.GeocoderResourceTest)
Test geocoding a city and state with Yahoo geocoder
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 149, in test_geocode_city_state_yahoo
    self.assertApxEqual(results[0].lat, 39.756655, .001)
IndexError: list index out of range

======================================================================
ERROR: test_geocode_city_yahoo (storybase_geo.tests.GeocoderResourceTest)
Test geocoding a city with Yahoo geocoder
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 171, in test_geocode_city_yahoo
    self.assertApxEqual(results[0].lat, 39.737567, .01)
IndexError: list index out of range

======================================================================
ERROR: test_geocode_intersection_yahoo (storybase_geo.tests.GeocoderResourceTest)
Test geocoding an intersection with Yahoo geocoder
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 138, in test_geocode_intersection_yahoo
    self.assertApxEqual(results[0].lat, 39.7399986)
IndexError: list index out of range

======================================================================
ERROR: test_geocode_zip_yahoo (storybase_geo.tests.GeocoderResourceTest)
Test geocoding a zip code with Yahoo geocoder
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 160, in test_geocode_zip_yahoo
    self.assertApxEqual(results[0].lat, 39.7541032, .01)
IndexError: list index out of range

======================================================================
ERROR: test_geocode (storybase_geo.tests.LocationModelTest)
Test internal geocoding method
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 38, in test_geocode
    latlng = loc._geocode("370 17th St Denver CO 80202")
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 96, in _geocode
    results = list(geocoder.geocode(address, exactly_one=False))
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 39, in geocode
    return self.geocode_url(url, exactly_one)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 43, in geocode_url
    return self.parse_json(page, exactly_one)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 52, in parse_json
    raise ValueError("No results found")
ValueError: No results found

======================================================================
ERROR: test_geocode_on_change (storybase_geo.tests.LocationModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 72, in test_geocode_on_change
    loc.save()
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/base.py", line 484, in save_base
    signals.pre_save.send(sender=origin, instance=self, raw=raw, using=using)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 118, in geocode
    instance.postcode))
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 96, in _geocode
    results = list(geocoder.geocode(address, exactly_one=False))
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 39, in geocode
    return self.geocode_url(url, exactly_one)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 43, in geocode_url
    return self.parse_json(page, exactly_one)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 52, in parse_json
    raise ValueError("No results found")
ValueError: No results found

======================================================================
ERROR: test_geocode_on_save (storybase_geo.tests.LocationModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 54, in test_geocode_on_save
    loc.save()
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/base.py", line 484, in save_base
    signals.pre_save.send(sender=origin, instance=self, raw=raw, using=using)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 118, in geocode
    instance.postcode))
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 96, in _geocode
    results = list(geocoder.geocode(address, exactly_one=False))
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 39, in geocode
    return self.geocode_url(url, exactly_one)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 43, in geocode_url
    return self.parse_json(page, exactly_one)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/yahoo.py", line 52, in parse_json
    raise ValueError("No results found")
ValueError: No results found

======================================================================
ERROR: test_delete_detail (storybase_geo.tests.LocationResourceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 309, in test_delete_detail
    obj = Location.objects.create(**self.location_attrs[0])
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/manager.py", line 138, in create
    return self.get_query_set().create(**kwargs)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/query.py", line 360, in create
    obj.save(force_insert=True, using=self.db)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/base.py", line 484, in save_base
    signals.pre_save.send(sender=origin, instance=self, raw=raw, using=using)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 118, in geocode
    instance.postcode))
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 96, in _geocode
    results = list(geocoder.geocode(address, exactly_one=False))
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/openmapquest.py", line 37, in geocode
    page = urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 394, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 412, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1199, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1174, in do_open
    raise URLError(err)
URLError: <urlopen error timed out>

======================================================================
ERROR: test_delete_detail_unauthenticated (storybase_geo.tests.LocationResourceTest)
Tests that an unauthenticated user cannot delete a location
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ghing/workspace/atlas/apps/storybase_geo/tests.py", line 324, in test_delete_detail_unauthenticated
    obj = Location.objects.create(**self.location_attrs[0])
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/manager.py", line 138, in create
    return self.get_query_set().create(**kwargs)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/query.py", line 360, in create
    obj.save(force_insert=True, using=self.db)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/db/models/base.py", line 484, in save_base
    signals.pre_save.send(sender=origin, instance=self, raw=raw, using=using)
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 118, in geocode
    instance.postcode))
  File "/home/ghing/workspace/atlas/apps/storybase_geo/models.py", line 96, in _geocode
    results = list(geocoder.geocode(address, exactly_one=False))
  File "/home/ghing/.virtualenvs/atlas/lib/python2.7/site-packages/geopy/geocoders/openmapquest.py", line 37, in geocode
    page = urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 394, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 412, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1199, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1174, in do_open
    raise URLError(err)
URLError: <urlopen error timed out>
ghing commented 12 years ago

As of this morning, these tests are no longer failing. Closing.