Ejemplo n.º 1
0
def test_full_travel_ctor(default_flights: Flights, default_hotels: Hotels, default_cars: Cars):
    """ Test case for Travel.__init__(**) method with Flights, Hotels and Cars

    RESTRICTION:
        The Flights, Hotels and Cars instances should have elements in.

    TEST CASE:
        Insertion of a Travel object from Flights, Hotels, Cars instances and number of travelers.

    EXPECTED BEHAVIOUR:
        The object is instantiated with the default values of Flights, Hotels and Cars.
    """

    travel = Travel(DEFAULT_NUM_TRAVELERS, default_flights, default_hotels, default_cars)

    assert isinstance(travel, Travel)

    assert len(travel._flights) != 0
    assert len(travel._hotels) != 0
    assert len(travel._cars) != 0
    assert len(travel._flights) == len(default_flights)
    assert len(travel._hotels) == len(default_hotels)
    assert len(travel._cars) == len(default_cars)

    assert travel.ticket_price == travel._default_price
    assert travel.hotel_price == travel._default_price
    assert travel.car_price == travel._default_price
    assert travel.cost == float()
Ejemplo n.º 2
0
def full_reservation(default_flights, default_user, default_hotels,
                     default_cars, mock_fetch_prices):
    """ Fixture to create a Reservation object from a default values of User, Travel with Flights, Cars and Hotels.

    """

    res = Reservation(
        Travel(DEFAULT_NUM_TRAVELERS, default_flights, default_hotels,
               default_cars))
    res._user = default_user
    res._payment_method = DEFAULT_CARD_TYPE
    res._payment_data = default_payment_data
    return res
Ejemplo n.º 3
0
def default_travel(default_flights):
    """ Fixture to create a Travel object from a default values and flights.

    """

    return Travel(DEFAULT_NUM_TRAVELERS, default_flights)