def test_retrieve_location_again(self): """ If provided a geonames URI that has already been retrieved, should return a Location object with that URI. """ location = retrieve_location(gn_uri) self.assertEqual(location.uri, gn_uri)
def test_retrieve_location(self): """ If provided a legit geonames URI, should return a Location object with that URI. """ location = retrieve_location(gn_uri) self.assertEqual(location.uri, gn_uri)
def test_retrieve_nonexistent(self): """ If the URI simply does not exist at that LocationAuthority, should return None. """ nonexistent_uri = 'http://www.geonames.org/6943991012349326760/asdf' location = retrieve_location(nonexistent_uri) self.assertEqual(location, None)