Exemple #1
0
 def test_multiple_minmax(self):
     self.assertIn(
         prog_2.sum_min_max(
             [-89, 1, 90, -89, 2, 90]
         ),
         [2, 5, 1, 3]
     )
Exemple #2
0
 def test_negative_test(self):
     self.assertEqual(
         prog_2.sum_min_max(
             [-794, -43, -8989, -11, -89]
         ),
         -9000
     )
Exemple #3
0
 def test_straight_sum(self):
     self.assertEqual(
         prog_2.sum_min_max(
             [1, -6, 0, 34, 434]
         ),
         462
     )
Exemple #4
0
 def test_float_compatibility(self):
     self.assertEqual(
         prog_2.sum_min_max(
             [1.32, -6.23, 0, 34, 434.001]
         ),
         461.77099999999996
     )
Exemple #5
0
 def test_reverse_sum(self):
     self.assertEqual(
         prog_2.sum_min_max(
             [1, 434, 0, 34, -6]
         ),
         462
     )
Exemple #6
0
 def test_two(self):
     self.assertEqual(
         prog_2.sum_min_max(
             [1, 2]
         ),
         3
     )
Exemple #7
0
 def test_one(self):
     self.assertEqual(
         prog_2.sum_min_max(
             [41]
         ),
         41
     )
Exemple #8
0
 def test_empty(self):
     self.assertEqual(
         prog_2.sum_min_max(
             []
         ),
         0
     )