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

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

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

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

        self.assertListEqual(list1, list2)