Ejemplo n.º 1
0
	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)
Ejemplo n.º 2
0
	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)
Ejemplo n.º 3
0
	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)
Ejemplo n.º 4
0
	def test_imaginary_name(self):
		"""
		Tests a place that doesn't exist
		"""
		self.assertEquals(None, routes.get_location_data("eskjfbwlkej"))
Ejemplo n.º 5
0
	def test_no_location(self):
		"""
		Tests no location output
		"""
		self.assertEquals(None, routes.get_location_data(""))