MCPcopy Create free account
hub / github.com/STIXProject/python-stix / test_description_output

Method test_description_output

stix/test/incident_test.py:425–441  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

423 self.assertEqual('Bar', categories[1].valueOf_)
424
425 def test_description_output(self):
426 incident = incident_binding.IncidentType()
427
428 assets = incident_binding.AffectedAssetsType()
429 asset = incident_binding.AffectedAssetType()
430
431 description = StructuredText("A Description")
432 asset.Structured_Description = description.to_obj()
433
434 assets.add_Affected_Asset(asset)
435 incident.Affected_Assets = assets
436
437 s = StringIO()
438
439 incident.export(s.write, 0, {'http://docs.oasis-open.org/cti/ns/stix/incident-1': 'incident'})
440 xml = s.getvalue()
441 self.assertTrue("A Description" in xml, "Description not exported")
442
443 def test_add_related_observable(self):
444 from cybox.core import Observable

Callers

nothing calls this directly

Calls 4

add_Affected_AssetMethod · 0.95
exportMethod · 0.95
StructuredTextClass · 0.90
to_objMethod · 0.45

Tested by

no test coverage detected