本文整理汇总了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")