Change "object_modified" property of LocationContent to be
optional. Add a corresponding unit test.master
parent
5649559c6d
commit
8362d80206
|
@ -71,3 +71,18 @@ def test_language_content_campaign():
|
||||||
# or https://docs.python.org/2/library/json.html#json.dumps
|
# or https://docs.python.org/2/library/json.html#json.dumps
|
||||||
assert lc.serialize(pretty=True, ensure_ascii=False) == TEST_LANGUAGE_CONTENT
|
assert lc.serialize(pretty=True, ensure_ascii=False) == TEST_LANGUAGE_CONTENT
|
||||||
assert lc.modified == camp.modified
|
assert lc.modified == camp.modified
|
||||||
|
|
||||||
|
|
||||||
|
def test_object_modified_optional():
|
||||||
|
"""
|
||||||
|
object_modified is now optional in STIX 2.1.
|
||||||
|
"""
|
||||||
|
|
||||||
|
stix2.v21.LanguageContent(
|
||||||
|
object_ref=CAMPAIGN_ID,
|
||||||
|
contents={
|
||||||
|
"en": {
|
||||||
|
"name": "the english text",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
|
@ -79,7 +79,7 @@ class LanguageContent(_STIXBase):
|
||||||
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')),
|
||||||
('object_ref', ReferenceProperty(spec_version='2.1', required=True)),
|
('object_ref', ReferenceProperty(spec_version='2.1', required=True)),
|
||||||
# TODO: 'object_modified' it MUST be an exact match for the modified time of the STIX Object (SRO or SDO) being referenced.
|
# TODO: 'object_modified' it MUST be an exact match for the modified time of the STIX Object (SRO or SDO) being referenced.
|
||||||
('object_modified', TimestampProperty(required=True, precision='millisecond')),
|
('object_modified', TimestampProperty(precision='millisecond')),
|
||||||
# TODO: 'contents' https://docs.google.com/document/d/1ShNq4c3e1CkfANmD9O--mdZ5H0O_GLnjN28a_yrEaco/edit#heading=h.cfz5hcantmvx
|
# TODO: 'contents' https://docs.google.com/document/d/1ShNq4c3e1CkfANmD9O--mdZ5H0O_GLnjN28a_yrEaco/edit#heading=h.cfz5hcantmvx
|
||||||
('contents', DictionaryProperty(spec_version='2.1', required=True)),
|
('contents', DictionaryProperty(spec_version='2.1', required=True)),
|
||||||
('revoked', BooleanProperty()),
|
('revoked', BooleanProperty()),
|
||||||
|
|
Loading…
Reference in New Issue