示例#1
0
    def test_s1(self):
        s1 = '1-5'
        list1 = [1, 2, 3, 4, 5]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)
示例#2
0
 def test_fail4(self):
     s1 = '-5'
     self.assertIsNone(parse_holestr(s1))
示例#3
0
 def test_fail5(self):
     s1 = '1-55-100'
     self.assertIsNone(parse_holestr(s1))
示例#4
0
    def test_s3(self):
        s1 = '1 -5, 7-10'
        list1 = [1, 2, 3, 4, 5, 7, 8, 9, 10]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)
示例#5
0
 def test_fail3(self):
     s1 = '1-,'
     self.assertIsNone(parse_holestr(s1))
示例#6
0
    def test_s1(self):
        s1 = '1-5'
        list1 = [1, 2, 3, 4, 5]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)
示例#7
0
    def test_s2(self):
        s1 = '1,2,3'
        list1 = [1, 2, 3]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)
示例#8
0
 def test_fail5(self):
     s1 = '1-55-100'
     self.assertIsNone(parse_holestr(s1))
示例#9
0
 def test_fail4(self):
     s1 = '-5'
     self.assertIsNone(parse_holestr(s1))
示例#10
0
 def test_fail3(self):
     s1 = '1-,'
     self.assertIsNone(parse_holestr(s1))
示例#11
0
    def test_s3(self):
        s1 = '1 -5, 7-10'
        list1 = [1, 2, 3, 4, 5, 7, 8, 9, 10]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)
示例#12
0
    def test_s2(self):
        s1 = '1,2,3'
        list1 = [1, 2, 3]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)