예제 #1
0
def test_check_reservation_wrong_house(service: ShowPricesForm,
                                       context: Context, house, reservation):
    context.house = house
    context.reservation = attr.evolve(reservation, house_id=999)

    result = service.check_reservation(context)
    assert not is_successful(result)
    assert result.failure().failure == ReservationErrors.missed_reservation
예제 #2
0
def test_check_reservation_canceled(service: ShowPricesForm, context: Context,
                                    house, reservation):
    context.house = house
    context.reservation = attr.evolve(reservation,
                                      status=ReservationStatuses.CANCEL)

    result = service.check_reservation(context)
    assert not is_successful(result)
    assert result.failure().failure == ReservationErrors.missed_reservation