Exemplo n.º 1
0
 def test_app_list(self):
     """Test generating the sum of the list hardcoded in main_program.py"""
     test_total = sum_of_list(list(range(10000001)))
     self.assertEqual(test_total, 50000005000000)
Exemplo n.º 2
0
 def test_mixed_numbers(self):
     """Test generating the sum of a list with mixed number types"""
     test_total = sum_of_list([5.5, -6.0454, 10, -10000001, -4, 0, -3.014, 10001])
     self.assertEqual(test_total, -9989997.5594)
Exemplo n.º 3
0
 def test_negative_int(self):
     """Test generating the sum of a list with non-int members in it"""
     test_total = sum_of_list([-5, -6, -10, -10000001, -4, -999999999999999999])
     self.assertEqual(test_total, -1000000000010000025)
Exemplo n.º 4
0
 def test_non_int(self):
     """Test generating the sum of a list with non-int members in it"""
     test_total = sum_of_list([5, 6, 10, 10000001, '4', 'a'])
     self.assertEqual(test_total, "Your list should contain only numbers")
Exemplo n.º 5
0
 def test_big_range(self):
     """Test generating the sum of a list bigger than 10000001 in length"""
     test_total = sum_of_list(list(range(100000002)))
     self.assertEqual(test_total, "Your list is too big")
Exemplo n.º 6
0
 def test_zero_range(self):
     """Test generating the sum of zero range"""
     test_total = sum_of_list(list(range(0)))
     self.assertEqual(test_total, 0)