Пример #1
0
 def test_running_sum_multi_pos(self):
     '''Test a list of positive values.'''
     inputted = [4, 2, 3, 6]
     tools.running_sum(inputted)
     output_expected = [4, 6, 9, 15]
     self.assertEqual(output_expected, inputted,
                      "Not working with positive values.")
Пример #2
0
 def test_running_sum_multi_mix(self):
     '''Test a list of mixed values.'''
     inputted = [4, 0, 2, -5]
     tools.running_sum(inputted)
     output_expected = [4, 4, 6, 1]
     self.assertEqual(output_expected, inputted,
                      "Not working with mixed values.")
Пример #3
0
 def test_running_sum_multi_neg(self):
     '''Test a list of negative values.'''
     inputted = [-1, -5, -3, -4]
     tools.running_sum(inputted)
     output_expected = [-1, -6, -9, -13]
     self.assertEqual(output_expected, inputted,
                      "The list contains only negative values.")
Пример #4
0
 def test_running_sum_one(self):
     '''Test a one-item list.'''
     inputted = [2]
     tools.running_sum(inputted)
     output_expected = [2]
     self.assertEqual(output_expected, inputted,
                      "The list contains one item.")
Пример #5
0
 def test_running_sum_two(self):
     '''Test a two-item list.'''
     inputted = [2, 5]
     tools.running_sum(inputted)
     output_expected = [2, 7]
     self.assertEqual(output_expected, inputted,
                      "The list contains two items.")
Пример #6
0
 def test_running_sum_multi_pos(self):
     '''Test a list of positive values.'''
     argument = [4, 2, 3, 6]
     expected = [4, 6, 9, 15]
     tools.running_sum(argument)
     self.assertEqual(expected, argument,
                      "The list contains only positive values.")
Пример #7
0
 def test_running_sum_multi_neg(self):
     '''Test a list of negative values.'''
     argument = [-1, -5, -3, -4]
     expected = [-1, -6, -9, -13]
     tools.running_sum(argument)
     self.assertEqual(expected, argument,
                      "The list contains only negative values.")
Пример #8
0
 def test_running_sum_multi_mix(self):
     '''Test a list of zeros.'''
     argument = [4, 0, 2, -5]
     expected = [4, 4, 6, 1]
     tools.running_sum(argument)
     self.assertEqual(
         expected, argument,
         "The list contains zeros and positive and negative values.")
Пример #9
0
 def test_running_sum_empty(self):
     '''Test an empty list.'''
     inputted = []
     tools.running_sum(inputted)
     output_expected = []
     self.assertEqual(output_expected, inputted, "The list is empty.")
Пример #10
0
 def test_running_sum_multi_zeros(self):
     '''Test a list of zeros.'''
     inputted = [0, 0, 0, 0]
     tools.running_sum(inputted)
     output_expected = [0, 0, 0, 0]
     self.assertEqual(output_expected, inputted, "Not working with zeros.")
Пример #11
0
 def test_running_sum_empty(self):
     '''Test an empty list.'''
     argument = []
     expected = []
     tools.running_sum(argument)
     self.assertEqual(expected, argument, "The list is empty.")
Пример #12
0
 def test_running_sum_multi_zeros(self):
     '''Test a list of zeros.'''
     argument = [0, 0, 0, 0]
     expected = [0, 0, 0, 0]
     tools.running_sum(argument)
     self.assertEqual(expected, argument, "The list contains only zeros.")
Пример #13
0
 def test_running_sum_two(self):
     '''Test a two-item list.'''
     argument = [2, 5]
     expected = [2, 7]
     tools.running_sum(argument)
     self.assertEqual(expected, argument, "The list contains two items.")
Пример #14
0
 def test_running_sum_one(self):
     '''Test a one-item list.'''
     argument = [2]
     expected = [2]
     tools.running_sum(argument)
     self.assertEqual(expected, argument, "The list contains one item.")