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')
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()
def testNonIncreasingEntries(self): ilp = flag_util.IntegerListParser( on_nonincreasing=flag_util.IntegerListParser.EXCEPTION) with self.assertRaises(ValueError): ilp.Parse('3,2,1')