Пример #1
0
    def test_area_bottom_right(self):
        # create booking
        booking = Booking()
        booking.client = self.client
        booking.passengers = 1
        booking.luggage_number = 2
        booking.flight = "18070-12324"
        booking.departure = Geoposition(49.010247, 2.547678)
        booking.destination = Geoposition(48.792502, 2.386336)
        booking.distance = math.hypot(48.792502 - 49.010247,
                                      2.386336 - 2.547678)
        # booking.destination = "Place de la Libération, 94400 Vitry-sur-Seine"

        self.assertFalse(booking is None)

        self.assertEqual(get_area(booking), self.bottom_right)
Пример #2
0
    def test_area_high_right(self):
        # create booking
        booking = Booking()
        booking.client = self.client
        booking.passengers = 1
        booking.luggage_number = 2
        booking.flight = "18070-12324"
        # booking.departure = "Aéroport Charles de Gaulle (T3-Roissypole), Tremblay-en-France"
        # booking.destination = "23 Rue Madeleine Vionnet, 93300 Aubervilliers"
        booking.departure = Geoposition(49.010247, 2.547678)
        booking.destination = Geoposition(48.903194, 2.374365)
        booking.distance = math.hypot(48.903194 - 49.010247,
                                      2.374365 - 2.547678)

        self.assertFalse(booking is None)

        self.assertEqual(get_area(booking), self.high_right)
Пример #3
0
    def test_area_high_left(self):
        # create booking
        booking = Booking()
        booking.client = self.client
        booking.passengers = 1
        booking.luggage_number = 2
        booking.flight = "18070-12324"
        # booking.departure = "Aéroport Charles de Gaulle (T3-Roissypole), Tremblay-en-France"
        # booking.destination = "Place Charles de Gaulle, 75008 Paris"
        booking.departure = Geoposition(49.010247, 2.547678)
        booking.destination = Geoposition(48.873959, 2.295825)
        booking.distance = math.hypot(48.873959 - 49.010247,
                                      2.295825 - 2.547678)

        self.assertFalse(booking is None)

        self.assertEqual(get_area(booking), self.high_left)
Пример #4
0
    def test_area_bottom_left(self):
        # create booking
        booking = Booking()
        booking.client = self.client
        booking.passengers = 1
        booking.luggage_number = 2
        booking.flight = "18070-12324"
        # booking.departure = "Aéroport Charles de Gaulle (T3-Roissypole), Tremblay-en-France"
        # booking.destination = "Champ de Mars, 5 Avenue Anatole France, 75007 Paris""
        booking.departure = Geoposition(49.010247, 2.547678)
        booking.destination = Geoposition(48.858956, 2.294512)
        booking.distance = math.hypot(48.858956 - 49.010247,
                                      2.294512 - 2.547678)

        self.assertFalse(booking is None)

        self.assertEqual(get_area(booking), self.bottom_left)