def testInvalidPrefixInput(): prefixRange = '192.168.1.s/100:100' actualResult = question._isPrefixRange(prefixRange) expectMessage = "Invalid prefix string: '192.168.1.s/100' in prefix range string: '{}'".format( prefixRange) assert not actualResult[0] assert expectMessage == actualResult[1]
def testValidPrefixRange(): prefixRange = "192.168.1.1/100:100-110" actualResult = question._isPrefixRange(prefixRange) assert actualResult[0] assert actualResult[1] is None
def testInvalidRangeInput(): prefixRange = "192.168.1.1/100:100-s110" actualResult = question._isPrefixRange(prefixRange) expectMessage = "Invalid subRange end: s110" assert not actualResult[0] assert expectMessage == actualResult[1]