示例#1
0
文件: test_flag.py 项目: aurule/npc
 def test_negative_limit(self):
     tag = Flag('type', 'asdf', '1234', limit=-1)
     tag.validate(strict=True)
     assert tag.valid
示例#2
0
文件: test_flag.py 项目: aurule/npc
 def test_under_limit(self):
     tag = Flag('type', 'asdf', '1234', limit=5)
     tag.validate(strict=True)
     assert tag.valid
示例#3
0
文件: test_flag.py 项目: aurule/npc
 def test_limit_exceeded(self):
     tag = Flag('type', 'asdf', '1234', limit=1)
     tag.validate(strict=True)
     assert not tag.valid
示例#4
0
文件: test_flag.py 项目: aurule/npc
 def test_hidden_values_must_exist(self):
     tag = Flag('type', 'value1')
     tag.hide_value('value2')
     tag.validate()
     assert not tag.valid
     assert "Value 'value2' for tag 'type' cannot be hidden, because it does not exist" in tag.problems
示例#5
0
文件: test_flag.py 项目: aurule/npc
 def test_limit_zero_and_required_are_fine(self):
     tag = Flag('type', 'asdf', required=True, limit=0)
     tag.validate()
     assert tag.valid
示例#6
0
文件: test_flag.py 项目: aurule/npc
 def test_required_with_values_passes(self):
     tag = Flag('type', 'asdf', required=True)
     tag.validate()
     assert tag.valid