Ejemplo n.º 1
0
    def test_s1(self):
        s1 = '1-5'
        list1 = [1, 2, 3, 4, 5]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)
Ejemplo n.º 2
0
 def test_fail4(self):
     s1 = '-5'
     self.assertIsNone(parse_holestr(s1))
Ejemplo n.º 3
0
 def test_fail5(self):
     s1 = '1-55-100'
     self.assertIsNone(parse_holestr(s1))
Ejemplo n.º 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)
Ejemplo n.º 5
0
 def test_fail3(self):
     s1 = '1-,'
     self.assertIsNone(parse_holestr(s1))
Ejemplo n.º 6
0
    def test_s1(self):
        s1 = '1-5'
        list1 = [1, 2, 3, 4, 5]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)
Ejemplo n.º 7
0
    def test_s2(self):
        s1 = '1,2,3'
        list1 = [1, 2, 3]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)
Ejemplo n.º 8
0
 def test_fail5(self):
     s1 = '1-55-100'
     self.assertIsNone(parse_holestr(s1))
Ejemplo n.º 9
0
 def test_fail4(self):
     s1 = '-5'
     self.assertIsNone(parse_holestr(s1))
Ejemplo n.º 10
0
 def test_fail3(self):
     s1 = '1-,'
     self.assertIsNone(parse_holestr(s1))
Ejemplo n.º 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)
Ejemplo n.º 12
0
    def test_s2(self):
        s1 = '1,2,3'
        list1 = [1, 2, 3]
        list2 = parse_holestr(s1)

        self.assertListEqual(list1, list2)