Test empty extension property serialization
parent
2966efa4f0
commit
ab687d8d0e
|
@ -1140,6 +1140,16 @@ def test_process_example_windows_process_ext_empty():
|
||||||
assert excinfo.value.properties == sorted(properties_of_extension)
|
assert excinfo.value.properties == sorted(properties_of_extension)
|
||||||
|
|
||||||
|
|
||||||
|
def test_process_example_extensions_empty():
|
||||||
|
proc = stix2.v20.Process(
|
||||||
|
pid=314,
|
||||||
|
name="foobar.exe",
|
||||||
|
extensions={},
|
||||||
|
)
|
||||||
|
|
||||||
|
assert '{}' in str(proc)
|
||||||
|
|
||||||
|
|
||||||
def test_process_example_with_WindowsProcessExt_Object():
|
def test_process_example_with_WindowsProcessExt_Object():
|
||||||
p = stix2.v20.Process(extensions={
|
p = stix2.v20.Process(extensions={
|
||||||
"windows-process-ext": stix2.v20.WindowsProcessExt(
|
"windows-process-ext": stix2.v20.WindowsProcessExt(
|
||||||
|
|
|
@ -1114,6 +1114,16 @@ def test_process_example_windows_process_ext_empty():
|
||||||
assert excinfo.value.properties == sorted(properties_of_extension)
|
assert excinfo.value.properties == sorted(properties_of_extension)
|
||||||
|
|
||||||
|
|
||||||
|
def test_process_example_extensions_empty():
|
||||||
|
proc = stix2.v20.Process(
|
||||||
|
pid=314,
|
||||||
|
name="foobar.exe",
|
||||||
|
extensions={},
|
||||||
|
)
|
||||||
|
|
||||||
|
assert '{}' in str(proc)
|
||||||
|
|
||||||
|
|
||||||
def test_process_example_with_WindowsProcessExt_Object():
|
def test_process_example_with_WindowsProcessExt_Object():
|
||||||
p = stix2.v21.Process(extensions={
|
p = stix2.v21.Process(extensions={
|
||||||
"windows-process-ext": stix2.v21.WindowsProcessExt(
|
"windows-process-ext": stix2.v21.WindowsProcessExt(
|
||||||
|
|
Loading…
Reference in New Issue