small tweaks and pre-commit changes

pull/1/head
Emmanuelle Vargas-Gonzalez 2021-03-31 12:44:15 -04:00
parent 6d285c47ae
commit dd6b847b10
2 changed files with 1 additions and 3 deletions

View File

@ -22,7 +22,6 @@ from .utils import NOW, PREFIX_21_REGEX, get_timestamp
from .versioning import new_version as _new_version
from .versioning import revoke as _revoke
DEFAULT_ERROR = "{type} must have {property}='{expected}'."
SCO_DET_ID_NAMESPACE = uuid.UUID("00abedb4-aa42-466c-9c01-fed23315a9b7")
@ -75,7 +74,7 @@ class _STIXBase(collections.abc.Mapping):
def _check_at_least_one_property(self, list_of_properties=None):
if not list_of_properties:
list_of_properties = sorted(list(self.__class__._properties.keys()))
list_of_properties = sorted(self.__class__._properties.keys())
if isinstance(self, _Observable):
props_to_remove = {"type", "id", "defanged", "spec_version"}
else:

View File

@ -17,7 +17,6 @@ from .exceptions import (
from .parsing import parse, parse_observable
from .utils import _get_dict, get_class_hierarchy_names, parse_into_datetime
TYPE_REGEX = re.compile(r'^-?[a-z0-9]+(-[a-z0-9]+)*-?$')
TYPE_21_REGEX = re.compile(r'^([a-z][a-z0-9]*)+([a-z0-9-]+)*-?$')
ERROR_INVALID_ID = (