예제 #1
0
 def testNonIncreasingRange(self):
     ilp = flag_util.IntegerListParser(
         on_nonincreasing=flag_util.IntegerListParser.EXCEPTION)
     with self.assertRaises(ValueError):
         ilp.parse('3-1')
     with self.assertRaises(ValueError):
         ilp.parse('3:1')
예제 #2
0
 def testIntegerListsWhichAreNotIncreasing(self):
     ilp = flag_util.IntegerListParser(
         on_nonincreasing=flag_util.IntegerListParser.EXCEPTION)
     with self.assertRaises(ValueError) as cm:
         ilp.parse('1-5,3-7')
     self.assertEqual('Integer list 1-5,3-7 is not increasing',
                      str(cm.exception))
 def setUp(self):
   self.ilp = flag_util.IntegerListParser()
예제 #4
0
 def testNonIncreasingEntries(self):
     ilp = flag_util.IntegerListParser(
         on_nonincreasing=flag_util.IntegerListParser.EXCEPTION)
     with self.assertRaises(ValueError):
         ilp.Parse('3,2,1')