Esempio n. 1
0
    def test_running_sum_two_items(self):
        """Test a two-item list."""

        argument = [2, 5]
        expected = [2, 7]
        sums.running_sum(argument)
        self.assertEqual(expected, argument, "The list contains two items.")
Esempio n. 2
0
 def test_running_sum_multi_positive(self):  # 6
     """Test a list of positive values."""
     argument = [4, 2, 3, 6]
     expected = [4, 6, 9, 15]
     sums.running_sum(argument)
     self.assertEqual(expected, argument,
                      "The list contains only positive values.")
Esempio n. 3
0
    def test_running_sum_one_item(self):
        """Test a one-item list."""

        argument = [5]
        expected = [5]
        sums.running_sum(argument)
        self.assertEqual(expected, argument, "The list contains one item.")
Esempio n. 4
0
    def test_running_sum_multi_zeros(self):
        """Test a list of zeros."""

        argument = [0, 0, 0, 0]
        expected = [0, 0, 0, 0]
        sums.running_sum(argument)
        self.assertEqual(expected, argument, "The list contains only zeros.")
Esempio n. 5
0
 def test_running_sum_multi_negative(self):  # 4
     """Test a list of negative values."""
     argument = [-1, -5, -3, -4]
     expected = [-1, -6, -9, -13]
     sums.running_sum(argument)
     self.assertEqual(expected, argument,
                      "The list contains only negative values.")
Esempio n. 6
0
    def test_running_sum_two_items(self):
        """Test a two-item list."""

        argument = [2, 5]
        expected = [2, 7]
        sums.running_sum(argument)
        self.assertEqual(expected, argument, "The list contains two items.")
Esempio n. 7
0
    def test_running_sum_empty(self):
        """Test an empty list."""

        argument = []
        expected = []
        sums.running_sum(argument)
        self.assertEqual(expected, argument, "The list is empty.")
Esempio n. 8
0
    def test_running_sum_empty(self):
        """Test an empty list."""

        argument = []
        expected = []
        sums.running_sum(argument)
        self.assertEqual(expected, argument, "The list is empty.")
Esempio n. 9
0
    def test_running_sum_multi_zeros(self):
        """Test a list of zeros."""

        argument = [0, 0, 0, 0]
        expected = [0, 0, 0, 0]
        sums.running_sum(argument)
        self.assertEqual(expected, argument, "The list contains only zeros.")
Esempio n. 10
0
    def test_running_sum_one_item(self):
        """Test a one item list"""

        argument = [5]
        expected = [5]
        sums.running_sum(argument)
        self.assertEqual(expected, argument, "The list contains one item.")
Esempio n. 11
0
    def test_running_sum_multi_negative(self):
        """Test a list of negative values."""

        argument = [-1, -5, -3, -4]
        expected = [-1, -6, -9, -13]
        sums.running_sum(argument)
        self.assertEqual(expected, argument,
            "The list contains only negative values.")
Esempio n. 12
0
    def test_running_sum_multi_positive(self):
        """Test a list of positive values."""

        argument = [4, 2, 3, 6]
        expected = [4, 6, 9, 15]
        sums.running_sum(argument)
        self.assertEqual(expected, argument,
            "The list contains only positive values.")
Esempio n. 13
0
 def test_running_sum_multi_mix(self):  # 7
     """Test a list containing mixture of negative values, zeros and positive values."""
     argument = [4, 0, 2, -5, 0]
     expected = [4, 4, 6, 1, 1]
     sums.running_sum(argument)
     self.assertEqual(
         expected, argument,
         "The list contains a mixture of negative values, zeros and positive values"
         ".")
    def test_running_sum_multi_mix(self):
        """음수와 0, 양수 값이 섞인 리스트를 테스트한다."""

        argument = [4, 0, 2, -5, 0]
        expected = [4, 4, 6, 1, 1]
        sums.running_sum(argument)
        self.assertEqual(
            expected, argument,
            "The list contains a mixture of negative values, zeros and" +
            "positive values.")
Esempio n. 15
0
    def test_running_sum_multi_mix(self):
        """Test a list containing mixture of negative values, zeros and
        positive values."""

        argument = [4, 0, 2, -5, 0]
        expected = [4, 4, 6, 1, 1]
        sums.running_sum(argument)
        self.assertEqual(expected, argument,
            "The list contains a mixture of negative values, zeros and"
                         + "positive values.")
Esempio n. 16
0
 def test_all_negative(self) :
   arg = [-1, -5, -3, -4]
   exp = [-1, -6, -9, -13]
   sums.running_sum(arg)
   self.assertEqual(arg, exp, "The list contains only negative values")
Esempio n. 17
0
 def test_all_mixed(self) :
   arg = [4, 0, 2, -5, 1]
   exp = [4, 4, 6, 1, 2]
   sums.running_sum(arg)
   self.assertEqual(arg, exp, "The list contains mixed values")
Esempio n. 18
0
 def test_all_negative(self):
     arg = [-1, -5, -3, -4]
     exp = [-1, -6, -9, -13]
     sums.running_sum(arg)
     self.assertEqual(arg, exp, "The list contains only negative values")
Esempio n. 19
0
 def test_all_mixed(self):
     arg = [4, 0, 2, -5, 1]
     exp = [4, 4, 6, 1, 2]
     sums.running_sum(arg)
     self.assertEqual(arg, exp, "The list contains mixed values")