Beispiel #1
0
 def test_get_min_max(self):
     self.assertEqual(get_min_max([2, 10, 9, 20, 30, 5, 0, 31, 100]),
                      (0, 100))
     print(get_min_max([2, 10, 9, 20, 30, 5, 0, 31, 100]))  # Prints 0, 100
Beispiel #2
0
 def test_one_element_array(self):
     self.assertIsNone(get_min_max([100]))
     print(get_min_max([
         100
     ]))  # Prints None. Hence one element array can't be max and min number
Beispiel #3
0
 def test_get_max_min_none(self):
     self.assertIsNone(get_min_max(None))
     print(get_min_max(None))  # Prints None
Beispiel #4
0
 def test_get_max_min_empty(self):
     self.assertIsNone(get_min_max([]))
     print(get_min_max([]))  # Prints None, empty array
Beispiel #5
0
 def test_get_max_min_negative_num(self):
     self.assertEqual(get_min_max([2, 10, 9, 20, 30, 5, 0, 31, -100]),
                      (-100, 31))
     print(get_min_max([2, 10, 9, 20, 30, 5, 0, 31,
                        -100]))  # Prints -100, 31