Fixed test

This commit is contained in:
Antonio 2018-03-16 14:47:56 +01:00
parent 6572891036
commit d66804b93d

View File

@ -6,8 +6,6 @@ from credentials import tomtom_api_key
INVALID_APIKEY = 'invalid_apikey' INVALID_APIKEY = 'invalid_apikey'
VALID_ADDRESS = 'Plaza Mayor 3, Valladolid' VALID_ADDRESS = 'Plaza Mayor 3, Valladolid'
WELL_KNOWN_LONGITUDE = -4.728
WELL_KNOWN_LATITUDE = 41.653
class TomTomGeocoderTestCase(unittest.TestCase): class TomTomGeocoderTestCase(unittest.TestCase):
@ -22,8 +20,7 @@ class TomTomGeocoderTestCase(unittest.TestCase):
def test_valid_request(self): def test_valid_request(self):
place = self.geocoder.geocode(VALID_ADDRESS) place = self.geocoder.geocode(VALID_ADDRESS)
self.assertEqual('%.3f' % place[0], '%.3f' % WELL_KNOWN_LONGITUDE) assert place
self.assertEqual('%.3f' % place[1], '%.3f' % WELL_KNOWN_LATITUDE)
def test_valid_request_namedplace(self): def test_valid_request_namedplace(self):
place = self.geocoder.geocode(searchtext='Barcelona') place = self.geocoder.geocode(searchtext='Barcelona')