def test_structured_coa(self): coa_ = coa.CourseOfAction() self.assertRaises(TypeError, setattr(coa_, "structured_coa", "ERROR")) from stix.extensions.structured_coa.generic_structured_coa import GenericStructuredCOA struct_coa = GenericStructuredCOA() struct_coa.description = "SUCCESS" coa_.structured_coa = struct_coa self.assertTrue(str(coa_.structured_coa.description) == "SUCCESS")
def test_deprecated_related_packages(self): c = coa.CourseOfAction() c.related_packages.append(STIXPackage()) self.assertEqual(len(c.related_packages), 1)