Exemplo n.º 1
0
 def test_find_max_list_is_not_a_list_UGLY(self):
     try:
         find_max(1234)
         self.fail(
         )  #El contrato no debe llegat aca,deberia fallar,entonces la funcion esta mal, y el test bien
     except Exception:  #except not a list exception (tambien estaria bien)
         pass
Exemplo n.º 2
0
 def test_find_max_list_not_all_number_in_list_UGLY(self):
     from list_numbers_2 import NotAListException
     from list_numbers_2 import NotAllNumberInListException
     try:
         find_max([1, 2, 3, 4, 'HOLA'])
         self.fail()
     except NotAListException:
         self.fail()
     except NotAllNumberInListException:
         pass
Exemplo n.º 3
0
 def test_find_max_list_is_not_a_list_UGLY_2(self):
     from list_numbers_2 import NotAListException
     from list_numbers_2 import NotAllNumberInListException
     try:
         find_max(1234)
         self.fail()
     except NotAListException:
         pass
     except NotAllNumberInListException:
         self.fail()
Exemplo n.º 4
0
 def test_find_max_simple_unorder_list(self):
     max_number = find_max([4, 1, 2, 3])
     self.assertEqual(max_number, 4)
Exemplo n.º 5
0
 def test_find_max_simple_list(self):
     max_number = find_max([1, 2, 3, 4])
     self.assertEqual(max_number, 4)
Exemplo n.º 6
0
 def test_find_max_list_is_not_a_list_UGLY_2(self):
     try:
         find_max([1234, 'hola'])
         self.fail()
     except Exception:
         pass
Exemplo n.º 7
0
 def test_find_max_list_is_not_a_list_UGLY(self):
     try:
         find_max(1234)
         self.fail()
     except Exception:
         pass
Exemplo n.º 8
0
 def test_find_max_empty_list(self):
     max_number = find_max([])
     self.assertIsNone(max_number)
Exemplo n.º 9
0
 def test_find_max_list_with_zero(self):
     max_number = find_max([0])
     self.assertEqual(max_number, 0)
Exemplo n.º 10
0
 def test_find_max_simple_with_similars_list(self):
     max_number = find_max([8, 8, 8, 8])
     self.assertEqual(max_number, 8)
Exemplo n.º 11
0
 def test_find_max_elem_is_not_a_number_UGLY(self):
     try:
         find_max([1234, 'hola'])
         self.fail()
     except Exception:
         pass