Пример #1
0
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]
Пример #2
0
def testValidPrefixRange():
    prefixRange = "192.168.1.1/100:100-110"
    actualResult = question._isPrefixRange(prefixRange)
    assert actualResult[0]
    assert actualResult[1] is None
Пример #3
0
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]