correct misspelling on _check_object_constraints

stix2.1
Richard Piazza 2017-05-18 09:48:01 -04:00
parent 8827149ef0
commit f8242cffe4
3 changed files with 27 additions and 26 deletions

View File

@ -77,7 +77,7 @@ class _STIXBase(collections.Mapping):
if failed_dependency_pairs: if failed_dependency_pairs:
raise DependentPropertiestError(self.__class__, failed_dependency_pairs) raise DependentPropertiestError(self.__class__, failed_dependency_pairs)
def _check_object_constaints(self): def _check_object_constraints(self):
if self.granular_markings: if self.granular_markings:
for m in self.granular_markings: for m in self.granular_markings:
# TODO: check selectors # TODO: check selectors
@ -111,7 +111,7 @@ class _STIXBase(collections.Mapping):
self._inner = setting_kwargs self._inner = setting_kwargs
self._check_object_constaints() self._check_object_constraints()
def __getitem__(self, key): def __getitem__(self, key):
return self._inner[key] return self._inner[key]

View File

@ -25,8 +25,8 @@ class Artifact(_Observable):
'hashes': HashesProperty(), 'hashes': HashesProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(Artifact, self)._check_object_constaints() super(Artifact, self)._check_object_constraints()
self._check_mutually_exclusive_properties(["payload_bin", "url"]) self._check_mutually_exclusive_properties(["payload_bin", "url"])
self._check_properties_dependency(["hashes"], ["url"]) self._check_properties_dependency(["hashes"], ["url"])
@ -82,8 +82,8 @@ class EmailMIMEComponent(_STIXBase):
'content_disposition': StringProperty(), 'content_disposition': StringProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(EmailMIMEComponent, self)._check_object_constaints() super(EmailMIMEComponent, self)._check_object_constraints()
self._check_at_least_one_property(["body", "body_raw_ref"]) self._check_at_least_one_property(["body", "body_raw_ref"])
@ -107,8 +107,8 @@ class EmailMessage(_Observable):
'raw_email_ref': ObjectReferenceProperty(), 'raw_email_ref': ObjectReferenceProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(EmailMessage, self)._check_object_constaints() super(EmailMessage, self)._check_object_constraints()
self._check_properties_dependency(["is_multipart"], ["body_multipart"]) self._check_properties_dependency(["is_multipart"], ["body_multipart"])
# self._dependency(["is_multipart"], ["body"], [False]) # self._dependency(["is_multipart"], ["body"], [False])
@ -135,8 +135,8 @@ class NTFSExt(_STIXBase):
'alternate_data_streams': ListProperty(EmbeddedObjectProperty(type=AlternateDataStream)), 'alternate_data_streams': ListProperty(EmbeddedObjectProperty(type=AlternateDataStream)),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(NTFSExt, self)._check_object_constaints() super(NTFSExt, self)._check_object_constraints()
self._check_at_least_one_property() self._check_at_least_one_property()
@ -149,8 +149,8 @@ class PDFExt(_STIXBase):
'pdfid1': StringProperty(), 'pdfid1': StringProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(PDFExt, self)._check_object_constaints() super(PDFExt, self)._check_object_constraints()
self._check_at_least_one_property() self._check_at_least_one_property()
@ -163,8 +163,8 @@ class RasterImageExt(_STIXBase):
'exif_tags': DictionaryProperty(), 'exif_tags': DictionaryProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(RasterImageExt, self)._check_object_constaints() super(RasterImageExt, self)._check_object_constraints()
self._check_at_least_one_property() self._check_at_least_one_property()
@ -203,8 +203,8 @@ class WindowsPEOptionalHeaderType(_STIXBase):
'hashes': HashesProperty(), 'hashes': HashesProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(WindowsPEOptionalHeaderType, self)._check_object_constaints() super(WindowsPEOptionalHeaderType, self)._check_object_constraints()
self._check_at_least_one_property() self._check_at_least_one_property()
@ -257,8 +257,8 @@ class File(_Observable):
'content_ref': ObjectReferenceProperty(), 'content_ref': ObjectReferenceProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(File, self)._check_object_constaints() super(File, self)._check_object_constraints()
self._check_properties_dependency(["is_encrypted"], ["encryption_algorithm", "decryption_key"]) self._check_properties_dependency(["is_encrypted"], ["encryption_algorithm", "decryption_key"])
self._check_at_least_one_property(["hashes", "name"]) self._check_at_least_one_property(["hashes", "name"])
@ -356,8 +356,8 @@ class TCPExt(_STIXBase):
'dst_flags_hex': HexProperty(), 'dst_flags_hex': HexProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(TCPExt, self)._check_object_constaints() super(TCPExt, self)._check_object_constraints()
self._check_at_least_one_property() self._check_at_least_one_property()
@ -385,8 +385,8 @@ class NetworkTraffic(_Observable):
'encapsulates_by_ref': ObjectReferenceProperty(), 'encapsulates_by_ref': ObjectReferenceProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(NetworkTraffic, self)._check_object_constaints() super(NetworkTraffic, self)._check_object_constraints()
self._check_at_least_one_property(["src_ref", "dst_ref"]) self._check_at_least_one_property(["src_ref", "dst_ref"])
@ -454,8 +454,9 @@ class Process(_Observable):
'child_refs': ListProperty(ObjectReferenceProperty), 'child_refs': ListProperty(ObjectReferenceProperty),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(Process, self)._check_object_constaints() # no need to check windows-service-ext, since it has a required property
super(Process, self)._check_object_constraints()
try: try:
self._check_at_least_one_property() self._check_at_least_one_property()
if self.extensions and "windows-process-ext" in self.extensions: if self.extensions and "windows-process-ext" in self.extensions:

View File

@ -15,8 +15,8 @@ class ExternalReference(_STIXBase):
'external_id': StringProperty(), 'external_id': StringProperty(),
} }
def _check_object_constaints(self): def _check_object_constraints(self):
super(ExternalReference, self)._check_object_constaints() super(ExternalReference, self)._check_object_constraints()
self._check_at_least_one_property(["description", "external_id", "url"]) self._check_at_least_one_property(["description", "external_id", "url"])