Example #1
0
 def test_hell_triangle(self):
     triangle = [[6], [3, 5], [9, 7, 1], [4, 6, 8, 4]]
     result = calculate_maximum_total(triangle)
     self.assertEqual(result, 26)
Example #2
0
 def test_invalid_input(self):
     triangle = [[6], [3], [9, 7, 1], [4, 6, 8, 4]]
     with self.assertRaises(IndexError):
         calculate_maximum_total(triangle)
Example #3
0
 def test_hell_triangle_with_one_element(self):
     triangle = [[6]]
     result = calculate_maximum_total(triangle)
     self.assertEqual(result, 6)
Example #4
0
 def test_empty_hell_triangle(self):
     triangle = []
     with self.assertRaises(IndexError):
         calculate_maximum_total(triangle)
Example #5
0
 def test_hell_triangle_3(self):
     triangle = [[6], [5, 3], [9, 7, 1], [10, 6, 8, 4], [1, 7, 5, 6, 7, 8]]
     result = calculate_maximum_total(triangle)
     self.assertEqual(result, 37)