def test_country_name(self): """ Tests only having a country name as input """ lat_lon = routes.get_location_data("USA") lat_lon = (round(lat_lon[0], 2), round(lat_lon[1], 2)) self.assertEquals((39.78, -100.45), lat_lon)
def test_city_name(self): """ Tests only having a city name as input """ lat_lon = routes.get_location_data("Sydney") lat_lon = (round(lat_lon[0], 2), round(lat_lon[1], 2)) self.assertEquals((-33.85, 151.22), lat_lon)
def test_state_name(self): """ Tests only having a state name as input """ lat_lon = routes.get_location_data("Illinois") lat_lon = (round(lat_lon[0], 2), round(lat_lon[1], 2)) self.assertEquals((40.08, -89.43), lat_lon)
def test_imaginary_name(self): """ Tests a place that doesn't exist """ self.assertEquals(None, routes.get_location_data("eskjfbwlkej"))
def test_no_location(self): """ Tests no location output """ self.assertEquals(None, routes.get_location_data(""))