[Python] How to create a DD path for a method

Discussão em 'Python' iniciado por Stack, Maio 25, 2025.

  1. Stack

    Stack Membro Participativo

    Can anyone help me with creating a DD path for a specific method? I tried making one but I am not sure that it is correct.

    The method is:

    @register.filter(name="book")
    def book(travel_date, travel_time):

    travel_dt = add(travel_date, travel_time)
    travel_ndt = datetime.strptime(travel_dt, '%Y-%m-%d %H:%M:%S')
    current_ndt = datetime.now()

    delta = travel_ndt - current_ndt
    total_hours = int(delta.total_seconds() // 3600)

    for hour in range(total_hours + 1):
    if hour >= 1:
    return True
    return False


    here you can see me trying to make the DD-path:

    The method and dd-path picture

    Continue reading...

Compartilhe esta Página