Exemple #1
0
    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")
Exemple #2
0
 def test_deprecated_related_packages(self):
     c = coa.CourseOfAction()
     c.related_packages.append(STIXPackage())
     self.assertEqual(len(c.related_packages), 1)