Test empty extension property serialization

master
Chris Lenk 2019-01-07 15:22:08 -05:00
parent 2966efa4f0
commit ab687d8d0e
2 changed files with 20 additions and 0 deletions

View File

@ -1140,6 +1140,16 @@ def test_process_example_windows_process_ext_empty():
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():
p = stix2.v20.Process(extensions={
"windows-process-ext": stix2.v20.WindowsProcessExt(

View File

@ -1114,6 +1114,16 @@ def test_process_example_windows_process_ext_empty():
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():
p = stix2.v21.Process(extensions={
"windows-process-ext": stix2.v21.WindowsProcessExt(