Add constrains to ObservedData and Sighting, tests updated.
parent
f8a72b0937
commit
352749edb0
|
@ -168,7 +168,7 @@ def test_custom_property_in_observed_data():
|
||||||
allow_custom=True,
|
allow_custom=True,
|
||||||
first_observed="2015-12-21T19:00:00Z",
|
first_observed="2015-12-21T19:00:00Z",
|
||||||
last_observed="2015-12-21T19:00:00Z",
|
last_observed="2015-12-21T19:00:00Z",
|
||||||
number_observed=0,
|
number_observed=1,
|
||||||
objects={"0": artifact},
|
objects={"0": artifact},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ def test_custom_property_object_in_observable_extension():
|
||||||
allow_custom=True,
|
allow_custom=True,
|
||||||
first_observed="2015-12-21T19:00:00Z",
|
first_observed="2015-12-21T19:00:00Z",
|
||||||
last_observed="2015-12-21T19:00:00Z",
|
last_observed="2015-12-21T19:00:00Z",
|
||||||
number_observed=0,
|
number_observed=1,
|
||||||
objects={"0": artifact},
|
objects={"0": artifact},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ def test_custom_property_dict_in_observable_extension():
|
||||||
allow_custom=True,
|
allow_custom=True,
|
||||||
first_observed="2015-12-21T19:00:00Z",
|
first_observed="2015-12-21T19:00:00Z",
|
||||||
last_observed="2015-12-21T19:00:00Z",
|
last_observed="2015-12-21T19:00:00Z",
|
||||||
number_observed=0,
|
number_observed=1,
|
||||||
objects={"0": artifact},
|
objects={"0": artifact},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ class ObservedData(STIXDomainObject):
|
||||||
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
||||||
('first_observed', TimestampProperty(required=True)),
|
('first_observed', TimestampProperty(required=True)),
|
||||||
('last_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)),
|
('objects', ObservableProperty(required=True)),
|
||||||
('revoked', BooleanProperty(default=lambda: False)),
|
('revoked', BooleanProperty(default=lambda: False)),
|
||||||
('labels', ListProperty(StringProperty)),
|
('labels', ListProperty(StringProperty)),
|
||||||
|
|
|
@ -64,7 +64,7 @@ class Sighting(STIXRelationshipObject):
|
||||||
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
||||||
('first_seen', TimestampProperty()),
|
('first_seen', TimestampProperty()),
|
||||||
('last_seen', TimestampProperty()),
|
('last_seen', TimestampProperty()),
|
||||||
('count', IntegerProperty()),
|
('count', IntegerProperty(min=0, max=999999999)),
|
||||||
('sighting_of_ref', ReferenceProperty(required=True)),
|
('sighting_of_ref', ReferenceProperty(required=True)),
|
||||||
('observed_data_refs', ListProperty(ReferenceProperty(type='observed-data'))),
|
('observed_data_refs', ListProperty(ReferenceProperty(type='observed-data'))),
|
||||||
('where_sighted_refs', ListProperty(ReferenceProperty(type='identity'))),
|
('where_sighted_refs', ListProperty(ReferenceProperty(type='identity'))),
|
||||||
|
|
Loading…
Reference in New Issue