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

Method test_add_related_indicator

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

Source from the content-addressed store, hash-verified

463 )
464
465 def test_add_related_indicator(self):
466 from stix.indicator import Indicator
467 from stix.common.related import RelatedIndicator
468
469 i = self.klass()
470
471 self.assertEqual(0, len(i.related_indicators))
472 i.add_related_indicator(Indicator())
473 self.assertEqual(1, len(i.related_indicators))
474
475 related = RelatedIndicator(Indicator())
476 i.add_related_indicator(related)
477 self.assertEqual(2, len(i.related_indicators))
478
479 # Test that this fails
480 self.assertRaises(
481 TypeError,
482 i.add_related_indicator,
483 "THIS SHOULD FAIL"
484 )
485
486 def test_add_description(self):
487 o1 = self.klass()

Callers

nothing calls this directly

Calls 3

IndicatorClass · 0.90
RelatedIndicatorClass · 0.90
add_related_indicatorMethod · 0.45

Tested by

no test coverage detected