From bf740b21eb1b91bd268515f52d7d779e007e1db2 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 12 Jun 2017 08:06:37 -0400 Subject: [PATCH] Initial selector and marking_ref validation. --- stix2/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stix2/base.py b/stix2/base.py index c40c9e6..d78c801 100644 --- a/stix2/base.py +++ b/stix2/base.py @@ -11,6 +11,7 @@ from .exceptions import (AtLeastOnePropertyError, DependentPropertiesError, MissingPropertiesError, MutuallyExclusivePropertiesError, RevokeError, UnmodifiablePropertyError) +from .markings.utils import validate from .utils import NOW, format_datetime, get_timestamp, parse_into_datetime __all__ = ['STIXJSONEncoder', '_STIXBase'] @@ -80,8 +81,7 @@ class _STIXBase(collections.Mapping): def _check_object_constraints(self): for m in self.get("granular_markings", []): - # TODO: check selectors - pass + validate(self, m.get("selectors"), m.get("marking_ref")) def __init__(self, **kwargs): cls = self.__class__