def test_select_reservation_room_ok(service: UpdateReservationPrices, context: Context, house, reservation): context.house = house context.source = reservation result = service.select_reservation_room(context) assert is_successful(result) assert result.unwrap().reservation_room == reservation.rooms[0]
def test_select_reservation_room_wrong_id(service: UpdateReservationPrices, context: Context, house, reservation): context.house = house context.source = reservation context.room_id = 999 result = service.select_reservation_room(context) assert not is_successful(result) assert result.failure().failure == ReservationErrors.missed_reservation