def test_invalid_namespace(self): mapping = InstanceMapping(self._NSMAP) mapping.selectors = "stix:STIX_Package, //stix:Package" mapping.label = "STIXType" def set_namespace(): mapping.namespace = "this will fail" self.assertRaises(errors.ProfileParseError, set_namespace)
def test_missing_namespace(self): mapping = InstanceMapping(self._NSMAP) mapping.selectors = "stix:STIX_Package, //stix:Package" mapping.label = "STIXType" self.assertRaises(errors.ProfileParseError, mapping.validate)
def test_missing_label(self): mapping = InstanceMapping(self._NSMAP) mapping.selectors = "stix:STIX_Package, //stix:Package" mapping.namespace = self._NAMESPACE self.assertRaises(errors.ProfileParseError, mapping.validate)