def testPosition(self): a = AirPort("EVE", "Evenes - Harstad/Narvik") latitude = 68.49111 longitude = 16.68057 a.position = Position(latitude, longitude) self.assertEqual(latitude, a.position.latitude) self.assertEqual(longitude, a.position.longitude)
def testGetClosestNorwegianAirport(self): trd = AirPort("TRD", "Trondheim") trd.position = Position(63.45943, 10.92621) eve = AirPort("EVE", "Harstad") eve.position = Position(68.49111, 16.68057) in_airports = [ trd, eve ] factory = AirPortFactory(in_airports) a = factory.get_closest_norwegian_airport(Position(63.41330, 10.35962)) self.assertTrue("TRD", a.code)