Minor fixes to tests. Some datastore had strange parameters in calls.
Fix error values for CustomMarking and fix incorrect test datastix2.1
parent
646d941032
commit
0197f9fd17
|
@ -670,7 +670,7 @@ def test_custom_extension():
|
||||||
with pytest.raises(stix2.exceptions.MissingPropertiesError) as excinfo:
|
with pytest.raises(stix2.exceptions.MissingPropertiesError) as excinfo:
|
||||||
NewExtension(property2=42)
|
NewExtension(property2=42)
|
||||||
assert excinfo.value.properties == ['property1']
|
assert excinfo.value.properties == ['property1']
|
||||||
assert str(excinfo.value) == "No values for required properties for _Custom: (property1)."
|
assert str(excinfo.value) == "No values for required properties for _CustomExtension: (property1)."
|
||||||
|
|
||||||
with pytest.raises(ValueError) as excinfo:
|
with pytest.raises(ValueError) as excinfo:
|
||||||
NewExtension(property1='something', property2=4)
|
NewExtension(property1='something', property2=4)
|
||||||
|
|
|
@ -421,7 +421,7 @@ def test_filesystem_object_with_custom_property(fs_store):
|
||||||
x_empire="Roman",
|
x_empire="Roman",
|
||||||
allow_custom=True)
|
allow_custom=True)
|
||||||
|
|
||||||
fs_store.add(camp, True)
|
fs_store.add(camp)
|
||||||
|
|
||||||
camp_r = fs_store.get(camp.id)
|
camp_r = fs_store.get(camp.id)
|
||||||
assert camp_r.id == camp.id
|
assert camp_r.id == camp.id
|
||||||
|
|
|
@ -14,8 +14,7 @@ stix_objs = [
|
||||||
],
|
],
|
||||||
"modified": "2017-01-27T13:49:53.997Z",
|
"modified": "2017-01-27T13:49:53.997Z",
|
||||||
"name": "Poison Ivy",
|
"name": "Poison Ivy",
|
||||||
"type": "malware",
|
"type": "malware"
|
||||||
"is_family": False
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"created": "2014-05-08T09:00:00.000Z",
|
"created": "2014-05-08T09:00:00.000Z",
|
||||||
|
|
|
@ -674,7 +674,7 @@ def test_custom_extension():
|
||||||
with pytest.raises(stix2.exceptions.MissingPropertiesError) as excinfo:
|
with pytest.raises(stix2.exceptions.MissingPropertiesError) as excinfo:
|
||||||
NewExtension(property2=42)
|
NewExtension(property2=42)
|
||||||
assert excinfo.value.properties == ['property1']
|
assert excinfo.value.properties == ['property1']
|
||||||
assert str(excinfo.value) == "No values for required properties for _Custom: (property1)."
|
assert str(excinfo.value) == "No values for required properties for _CustomExtension: (property1)."
|
||||||
|
|
||||||
with pytest.raises(ValueError) as excinfo:
|
with pytest.raises(ValueError) as excinfo:
|
||||||
NewExtension(property1='something', property2=4)
|
NewExtension(property1='something', property2=4)
|
||||||
|
|
|
@ -417,7 +417,7 @@ def test_filesystem_object_with_custom_property(fs_store):
|
||||||
x_empire="Roman",
|
x_empire="Roman",
|
||||||
allow_custom=True)
|
allow_custom=True)
|
||||||
|
|
||||||
fs_store.add(camp, True)
|
fs_store.add(camp)
|
||||||
|
|
||||||
camp_r = fs_store.get(camp.id)
|
camp_r = fs_store.get(camp.id)
|
||||||
assert camp_r.id == camp.id
|
assert camp_r.id == camp.id
|
||||||
|
|
Loading…
Reference in New Issue