本文整理汇总了Python中cybox.core.Observables.observable_package_source方法的典型用法代码示例。如果您正苦于以下问题:Python Observables.observable_package_source方法的具体用法?Python Observables.observable_package_source怎么用?Python Observables.observable_package_source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cybox.core.Observables
的用法示例。
在下文中一共展示了Observables.observable_package_source方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_round_trip
# 需要导入模块: from cybox.core import Observables [as 别名]
# 或者: from cybox.core.Observables import observable_package_source [as 别名]
def test_round_trip(self):
a = Address("[email protected]", Address.CAT_EMAIL)
a2 = Address("[email protected]", Address.CAT_EMAIL)
ms = MeasureSource()
ms.class_ = "System"
ms.source_type = "Analysis"
ms.description = StructuredText("A Description")
o = Observables([a, a2])
o.observable_package_source = ms
o2 = round_trip(o, output=True)
self.assertEqual(o.to_dict(), o2.to_dict())
示例2: _create_observables
# 需要导入模块: from cybox.core import Observables [as 别名]
# 或者: from cybox.core.Observables import observable_package_source [as 别名]
def _create_observables(self, msg):
o = Observables(self.__parse_email_message(msg))
t = ToolInformation()
t.name = os.path.basename(__file__)
t.description = StructuredText("Email to CybOX conversion script")
t.vendor = "The MITRE Corporation"
t.version = __version__
t_list = ToolInformationList()
t_list.append(t)
m = MeasureSource()
m.tools = t_list
o.observable_package_source = m
return o