示例#1
0
文件: base.py 项目: rolaya/os-ken
def validate_med(med):
    if med is not None and not validation.is_valid_med(med):
        raise ConfigValueError(desc='Invalid multi-exit-discriminatory (med)'
                               ' value: %s.' % med)
    return med
示例#2
0
 def test_is_valid_med_over(self):
     eq_(False, validation.is_valid_med(0xffffffff + 1))
示例#3
0
 def test_is_valid_med_not_num(self):
     eq_(False, validation.is_valid_med('foo'))
示例#4
0
 def test_is_valid_med_negative(self):
     eq_(False, validation.is_valid_med(-1))
示例#5
0
 def test_is_valid_med(self):
     ok_(validation.is_valid_med(100))