def test_souldReturnAnIntegerIfMaxIsOdd(self): (centre, list_triee, longueur, recherche) = estimer_min_max_precision.estim_min(0, 7) self.assertEqual(type(centre), int)
def test_shouldRetun2IfMyFirstAttempsIsCenter(self): (centre, list_triee, longueur, recherche) = estimer_min_max_precision.estim_min(0, 7) self.assertEqual(centre, list_triee[7 // 2])
def test_shouldReturnLongeur2LalisteEq3ifMaxEq3(self): (centre, list_triee, longueur, recherche) = estimer_min_max_precision.estim_min(0, 6) self.assertEqual(longueur, 6)
def test_shouldReturnASortedList(self): (centre, list_triee, longeur, recherche) = estimer_min_max_precision.estim_min(0, 6) self.assertEqual(list_triee, [0, 1, 2, 3, 4, 5])
def test_raiseErrorIfTabIsNull(self): with self.assertRaises(ValueError): estimer_min_max_precision.estim_min("", "")
def test_raiseErrorIfTabDimIslowerthan3(self): with self.assertRaises(ValueError): estimer_min_max_precision.estim_min(1, 2)
def test_shouldreturn5ifMinEq0andMaxEq10(self): (centre, liste, longueur, recherche) = estimer_min_max_precision.estim_min(0, 10) self.assertEqual(centre, 5)