def test_select_rate_by_guest_count_fail(service: CalculateNewReservation, context: Context, house, room_type, rate_plan, rate): context.house = house context.room_type = room_type context.rate_plan = rate_plan context.rates = [] result = service.select_rate_by_guest_count(context) assert is_successful(result) assert result.unwrap().rate is None
def test_select_rate_by_guest_count_only_less(service: CalculateNewReservation, context: Context, house, room_type, rate_plan, rate): rate_with_1 = attr.evolve(rate, id=401, occupancy=1) context.house = house context.room_type = room_type context.rate_plan = rate_plan context.rates = [rate_with_1] result = service.select_rate_by_guest_count(context) assert is_successful(result) assert result.unwrap().rate == rate_with_1