Add constrains to ObservedData and Sighting, tests updated.

stix2.1
Emmanuelle Vargas-Gonzalez 2018-10-17 07:47:25 -04:00
parent f8a72b0937
commit 352749edb0
3 changed files with 5 additions and 5 deletions

View File

@ -168,7 +168,7 @@ def test_custom_property_in_observed_data():
allow_custom=True,
first_observed="2015-12-21T19:00:00Z",
last_observed="2015-12-21T19:00:00Z",
number_observed=0,
number_observed=1,
objects={"0": artifact},
)
@ -190,7 +190,7 @@ def test_custom_property_object_in_observable_extension():
allow_custom=True,
first_observed="2015-12-21T19:00:00Z",
last_observed="2015-12-21T19:00:00Z",
number_observed=0,
number_observed=1,
objects={"0": artifact},
)
@ -225,7 +225,7 @@ def test_custom_property_dict_in_observable_extension():
allow_custom=True,
first_observed="2015-12-21T19:00:00Z",
last_observed="2015-12-21T19:00:00Z",
number_observed=0,
number_observed=1,
objects={"0": artifact},
)

View File

@ -203,7 +203,7 @@ class ObservedData(STIXDomainObject):
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
('first_observed', TimestampProperty(required=True)),
('last_observed', TimestampProperty(required=True)),
('number_observed', IntegerProperty(required=True)),
('number_observed', IntegerProperty(min=1, max=999999999, required=True)),
('objects', ObservableProperty(required=True)),
('revoked', BooleanProperty(default=lambda: False)),
('labels', ListProperty(StringProperty)),

View File

@ -64,7 +64,7 @@ class Sighting(STIXRelationshipObject):
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
('first_seen', TimestampProperty()),
('last_seen', TimestampProperty()),
('count', IntegerProperty()),
('count', IntegerProperty(min=0, max=999999999)),
('sighting_of_ref', ReferenceProperty(required=True)),
('observed_data_refs', ListProperty(ReferenceProperty(type='observed-data'))),
('where_sighted_refs', ListProperty(ReferenceProperty(type='identity'))),