示例#1
0
文件: sol.py 项目: dthinkcs/ps
1
import program
2
import unittest
3
​
4
​
5
class TestProgram(unittest.TestCase):
6

7
    def test_case_1(self):
8
        self.assertEqual(program.maxSubsetSumNoAdjacent([]), 0)
9

10
    def test_case_2(self):
11
        self.assertEqual(program.maxSubsetSumNoAdjacent([1]), 1)
12

13
    def test_case_3(self):
14
        self.assertEqual(program.maxSubsetSumNoAdjacent([1, 2]), 2)
15

16
示例#2
0
 def test_case_13(self):
     self.assertEqual(
         program.maxSubsetSumNoAdjacent(
             [7, 10, 12, 7, 9, 14, 15, 16, 25, 20, 4]), 72)
示例#3
0
 def test_case_1(self):
     self.assertEqual(program.maxSubsetSumNoAdjacent([]), 0)
示例#4
0
 def test_case_10(self):
     self.assertEqual(
         program.maxSubsetSumNoAdjacent([125, 210, 250, 120, 150, 300]),
         675)
示例#5
0
 def test_case_12(self):
     self.assertEqual(
         program.maxSubsetSumNoAdjacent([30, 25, 50, 55, 100, 120]), 205)
示例#6
0
 def test_case_9(self):
     self.assertEqual(
         program.maxSubsetSumNoAdjacent(
             [10, 5, 20, 25, 15, 5, 5, 15, 3, 15, 5, 5, 15]), 90)
示例#7
0
 def test_case_7(self):
     self.assertEqual(program.maxSubsetSumNoAdjacent([4, 3, 5, 200, 5, 3]),
                      207)
示例#8
0
 def test_case_6(self):
     self.assertEqual(program.maxSubsetSumNoAdjacent([7, 10, 12, 7, 9, 14]),
                      33)
示例#9
0
 def test_case_5(self):
     self.assertEqual(program.maxSubsetSumNoAdjacent([1, 15, 3]), 15)
示例#10
0
 def test_case_3(self):
     self.assertEqual(program.maxSubsetSumNoAdjacent([1, 2]), 2)