Exemplo n.º 1
0
 def test_souldReturnAnIntegerIfMaxIsOdd(self):
     (centre, list_triee, longueur,
      recherche) = estimer_min_max_precision.estim_min(0, 7)
     self.assertEqual(type(centre), int)
Exemplo n.º 2
0
 def test_shouldRetun2IfMyFirstAttempsIsCenter(self):
     (centre, list_triee, longueur,
      recherche) = estimer_min_max_precision.estim_min(0, 7)
     self.assertEqual(centre, list_triee[7 // 2])
Exemplo n.º 3
0
 def test_shouldReturnLongeur2LalisteEq3ifMaxEq3(self):
     (centre, list_triee, longueur,
      recherche) = estimer_min_max_precision.estim_min(0, 6)
     self.assertEqual(longueur, 6)
Exemplo n.º 4
0
 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])
Exemplo n.º 5
0
 def test_raiseErrorIfTabIsNull(self):
     with self.assertRaises(ValueError):
         estimer_min_max_precision.estim_min("", "")
Exemplo n.º 6
0
 def test_raiseErrorIfTabDimIslowerthan3(self):
     with self.assertRaises(ValueError):
         estimer_min_max_precision.estim_min(1, 2)
Exemplo n.º 7
0
 def test_shouldreturn5ifMinEq0andMaxEq10(self):
     (centre, liste, longueur,
      recherche) = estimer_min_max_precision.estim_min(0, 10)
     self.assertEqual(centre, 5)