示例#1
0
文件: test_flag.py 项目: aurule/npc
def test_clear_resets_presence():
    tag = Flag('wanderer')
    tag.touch()
    assert tag.present
    tag.clear()
    assert not tag.present
示例#2
0
文件: test_flag.py 项目: aurule/npc
def test_bool_truthy_when_present():
    tag = Flag('foreign')
    assert not tag
    tag.touch()
    assert tag
示例#3
0
文件: test_flag.py 项目: aurule/npc
def test_not_filled_with_no_values():
    flag = Flag('wanderer')
    flag.touch()
    assert not flag.filled
示例#4
0
文件: test_flag.py 项目: aurule/npc
 def test_update_from_flag_copies_presence(self):
     copyable = Flag('wanderer')
     copyable.touch()
     tag = Flag('wanderer')
     tag.update(copyable)
     assert tag.present
示例#5
0
文件: test_flag.py 项目: aurule/npc
def test_present_with_no_values():
    flag = Flag('wanderer')
    flag.touch()
    assert flag.present
示例#6
0
文件: test_flag.py 项目: aurule/npc
 def test_required_with_no_values_passes(self):
     tag = Flag('type', required=True)
     tag.touch()
     tag.validate()
     assert tag.valid
示例#7
0
文件: test_flag.py 项目: aurule/npc
def test_header_filled_with_no_values():
    flag = Flag('wanderer')
    flag.touch()
    header = flag.to_header()
    assert '@wanderer' in header