def test_buscar_raices(self): COEFICIENTES_RAICES = [ ((1,0,0), (0, 0)), ((-1,1,2), (-1, 2)), ((-1,0,4), (-2, 2)), ] for coef, raices_esperadas in COEFICIENTES_RAICES: raices = buscar_raices(coef[0], coef[1], coef[2]) self.assertEquals(raices, raices_esperadas)
def test_integridad_falla(self): COEFICIENTES = [ (2, 3, 0), (-2, 0, 4), (2, 0, -4), ] for a, b, c in COEFICIENTES: raices = buscar_raices(a, b, c) coeficientes = buscar_coeficientes(raices[0], raices[1]) self.assertNotEqual(coeficientes, (a, b, c))
def test_integridad(self): RAICES = [ (0, 0), (1, 2), (2.5, 3.5), (100, 1000), ] for r1, r2 in RAICES: a, b, c = buscar_coeficientes(r1, r2) raices = buscar_raices(a, b, c) self.assertEquals(raices, (r1, r2))