def test_et_idref_deprecation(self): package = core.STIXPackage() package.add(ExploitTarget(idref='test-idref-dep'))
def test_campaign_idref_deprecation(self): package = core.STIXPackage() package.add(Campaign(idref='test-idref-dep'))
def test_coa_idref_deprecation(self): package = core.STIXPackage() package.add(CourseOfAction(idref='test-idref-dep'))
def test_deprecated_idref(self): p = core.STIXPackage() p.idref = "test" self.assertEqual(p.idref, "test")
def test_deprecated_timestamp(self): p = core.STIXPackage() ts = now() p.timestamp = ts self.assertEqual(ts, p.timestamp)
def test_related_package_idref_deprecation(self): package = core.STIXPackage() package.add_related_package(core.STIXPackage(idref='foo'))
def test_ttp_idref_deprecation(self): package = core.STIXPackage() package.add(TTP(idref='test-idref-dep'))
def test_ta_idref_deprecation(self): package = core.STIXPackage() package.add(ThreatActor(idref='test-idref-dep'))
def test_indicator_idref_deprecation(self): package = core.STIXPackage() package.add(Indicator(idref='test-idref-dep'))
def test_setting_report_ttps_fails_on_stix_package(self): self.assertRaises( TypeError, core.STIXPackage(), report.TTPs(), 'TTPs must be a <class \'stix.core.ttps.TTPs\'>, not a <class \'stix.report.TTPs\'>' )