Fixes #248
parent
f8d4669f80
commit
e748923f19
|
@ -143,12 +143,12 @@ class _STIXBase(collections.Mapping):
|
||||||
if custom_props:
|
if custom_props:
|
||||||
self.__allow_custom = True
|
self.__allow_custom = True
|
||||||
|
|
||||||
# Remove any keyword arguments whose value is None
|
# Remove any keyword arguments whose value is None or [] (i.e. empty list)
|
||||||
setting_kwargs = {}
|
setting_kwargs = {}
|
||||||
props = kwargs.copy()
|
props = kwargs.copy()
|
||||||
props.update(custom_props)
|
props.update(custom_props)
|
||||||
for prop_name, prop_value in props.items():
|
for prop_name, prop_value in props.items():
|
||||||
if prop_value is not None:
|
if prop_value is not None and prop_value != []:
|
||||||
setting_kwargs[prop_name] = prop_value
|
setting_kwargs[prop_name] = prop_value
|
||||||
|
|
||||||
# Detect any missing required properties
|
# Detect any missing required properties
|
||||||
|
|
|
@ -107,7 +107,6 @@ def test_add_markings_combination():
|
||||||
"data", [
|
"data", [
|
||||||
([""]),
|
([""]),
|
||||||
(""),
|
(""),
|
||||||
([]),
|
|
||||||
([MARKING_IDS[0], 456]),
|
([MARKING_IDS[0], 456]),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -576,7 +575,6 @@ def test_set_marking():
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"data", [
|
"data", [
|
||||||
([]),
|
|
||||||
([""]),
|
([""]),
|
||||||
(""),
|
(""),
|
||||||
([MARKING_IDS[4], 687]),
|
([MARKING_IDS[4], 687]),
|
||||||
|
|
|
@ -106,7 +106,6 @@ def test_add_markings_combination():
|
||||||
"data", [
|
"data", [
|
||||||
([""]),
|
([""]),
|
||||||
(""),
|
(""),
|
||||||
([]),
|
|
||||||
([MARKING_IDS[0], 456]),
|
([MARKING_IDS[0], 456]),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -575,7 +574,6 @@ def test_set_marking():
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"data", [
|
"data", [
|
||||||
([]),
|
|
||||||
([""]),
|
([""]),
|
||||||
(""),
|
(""),
|
||||||
([MARKING_IDS[4], 687]),
|
([MARKING_IDS[4], 687]),
|
||||||
|
|
Loading…
Reference in New Issue