Added "x-" to SCO extension names in unit tests, to illustrate
best practice and follow a spec "should" rule.master
parent
371bf0b9a4
commit
15316e7933
|
@ -800,7 +800,7 @@ def test_custom_extension_wrong_observable_type():
|
||||||
)
|
)
|
||||||
def test_custom_extension_with_list_and_dict_properties_observable_type(data):
|
def test_custom_extension_with_list_and_dict_properties_observable_type(data):
|
||||||
@stix2.v21.CustomExtension(
|
@stix2.v21.CustomExtension(
|
||||||
stix2.v21.UserAccount, 'some-extension-ext', [
|
stix2.v21.UserAccount, 'x-some-extension-ext', [
|
||||||
('keys', stix2.properties.ListProperty(stix2.properties.DictionaryProperty, required=True)),
|
('keys', stix2.properties.ListProperty(stix2.properties.DictionaryProperty, required=True)),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -946,14 +946,14 @@ def test_custom_and_spec_extension_mix():
|
||||||
file_obs = stix2.v21.File(
|
file_obs = stix2.v21.File(
|
||||||
name="my_file.dat",
|
name="my_file.dat",
|
||||||
extensions={
|
extensions={
|
||||||
"custom1-ext": {
|
"x-custom1-ext": {
|
||||||
"a": 1,
|
"a": 1,
|
||||||
"b": 2,
|
"b": 2,
|
||||||
},
|
},
|
||||||
"ntfs-ext": {
|
"ntfs-ext": {
|
||||||
"sid": "S-1-whatever",
|
"sid": "S-1-whatever",
|
||||||
},
|
},
|
||||||
"custom2-ext": {
|
"x-custom2-ext": {
|
||||||
"z": 99.9,
|
"z": 99.9,
|
||||||
"y": False,
|
"y": False,
|
||||||
},
|
},
|
||||||
|
@ -966,8 +966,8 @@ def test_custom_and_spec_extension_mix():
|
||||||
allow_custom=True,
|
allow_custom=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert file_obs.extensions["custom1-ext"] == {"a": 1, "b": 2}
|
assert file_obs.extensions["x-custom1-ext"] == {"a": 1, "b": 2}
|
||||||
assert file_obs.extensions["custom2-ext"] == {"y": False, "z": 99.9}
|
assert file_obs.extensions["x-custom2-ext"] == {"y": False, "z": 99.9}
|
||||||
assert file_obs.extensions["ntfs-ext"].sid == "S-1-whatever"
|
assert file_obs.extensions["ntfs-ext"].sid == "S-1-whatever"
|
||||||
assert file_obs.extensions["raster-image-ext"].image_height == 1024
|
assert file_obs.extensions["raster-image-ext"].image_height == 1024
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue