本文整理匯總了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')