本文整理汇总了Python中fuglu.shared.Suspect.get_tag方法的典型用法代码示例。如果您正苦于以下问题:Python Suspect.get_tag方法的具体用法?Python Suspect.get_tag怎么用?Python Suspect.get_tag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fuglu.shared.Suspect
的用法示例。
在下文中一共展示了Suspect.get_tag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_something
# 需要导入模块: from fuglu.shared import Suspect [as 别名]
# 或者: from fuglu.shared.Suspect import get_tag [as 别名]
def test_something(self):
"""Test if examine runs through"""
from fuglu.shared import Suspect
suspect=Suspect('[email protected]','[email protected]','/dev/null')
self.candidate.examine(suspect)
self.failIf(suspect.get_tag('ExamplePlugin.time')==None, "Examine didn't run through")
示例2: test_score
# 需要导入模块: from fuglu.shared import Suspect [as 别名]
# 或者: from fuglu.shared.Suspect import get_tag [as 别名]
def test_score(self):
suspect=Suspect('[email protected]','[email protected]','/dev/null')
stream="""Date: Mon, 08 Sep 2008 17:33:54 +0200
To: [email protected]
From: [email protected]
Subject: test scanner
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
"""
suspect.setSource(stream)
result=self.candidate.examine(suspect)
if type(result) is tuple:
result,message=result
score=int( suspect.get_tag('SAPlugin.spamscore'))
self.failUnless(score>999, "GTUBE mails should score ~1000 , we got %s"%score)
self.failUnless(result==REJECT,'High spam should be rejected')