FlowController no tira ValueError cuando se setea Timeout a "-1"

Bug #480804 reported by Mauro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lalita
Fix Released
High
Unassigned

Bug Description

El problema sucede al comparar si el timeout es menor que sero, este chequeo falla si timeout es un string numerico negativo ("-1"...etc). Este error no es capturado ya que float(timeout), convierte efectivamente al numero correspondiente, pero luego la comparacion se hace sobre el parametro y no sobre el atributo timeout de FlowController

self.timeout = float(timeout)
if timeout <= 0:
     raise ValueError("The timeout if present should be > 0, "received: %r" % timeout)

El test que habria que agregar en test_timeout seria:
self.assertRaises(ValueError, flowcontrol.FlowController, f, 1, "-5")

Changed in lalita:
status: New → Confirmed
importance: Undecided → High
milestone: none → alpha
Revision history for this message
Facundo Batista (facundo) wrote :

Test agregado y código corregido.

¡Muchas gracias!

Changed in lalita:
status: Confirmed → Fix Committed
Changed in lalita:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.