本文整理匯總了Python中fuglu.shared.Suspect.is_virus方法的典型用法代碼示例。如果您正苦於以下問題:Python Suspect.is_virus方法的具體用法?Python Suspect.is_virus怎麽用?Python Suspect.is_virus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fuglu.shared.Suspect
的用法示例。
在下文中一共展示了Suspect.is_virus方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_virus
# 需要導入模塊: from fuglu.shared import Suspect [as 別名]
# 或者: from fuglu.shared.Suspect import is_virus [as 別名]
def test_virus(self):
"""Test if eicar is detected as virus"""
from fuglu.shared import Suspect
import shutil
self.mc.load_plugins()
if len(self.mc.plugins) == 0:
raise Exception("plugins not loaded")
sesshandler = SessionHandler(
None, self.mc.config, self.mc.prependers, self.mc.plugins, self.mc.appenders)
tempfilename = tempfile.mktemp(
suffix='virus', prefix='fuglu-unittest', dir='/tmp')
shutil.copy(TESTDATADIR + '/eicar.eml', tempfilename)
self.tempfiles.append(tempfilename)
suspect = Suspect(
'[email protected]', '[email protected]', tempfilename)
pluglist = sesshandler.run_prependers(suspect)
self.assertFalse(
len(pluglist) == 0, "Viruscheck will fail, pluginlist empty after run_prependers")
sesshandler.run_plugins(suspect, pluglist)
self.assertTrue(
suspect.is_virus(), "Eicar message was not detected as virus")