From 0197f9fd17cfc84cee1a2fe9df2328d7caa2fc26 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Mon, 9 Jul 2018 15:20:04 -0400 Subject: [PATCH] Minor fixes to tests. Some datastore had strange parameters in calls. Fix error values for CustomMarking and fix incorrect test data --- stix2/test/v20/test_custom.py | 2 +- stix2/test/v20/test_datastore_filesystem.py | 2 +- stix2/test/v20/test_datastore_filters.py | 3 +-- stix2/test/v21/test_custom.py | 2 +- stix2/test/v21/test_datastore_filesystem.py | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/stix2/test/v20/test_custom.py b/stix2/test/v20/test_custom.py index 3b8f192..a2d5dbe 100644 --- a/stix2/test/v20/test_custom.py +++ b/stix2/test/v20/test_custom.py @@ -670,7 +670,7 @@ def test_custom_extension(): with pytest.raises(stix2.exceptions.MissingPropertiesError) as excinfo: NewExtension(property2=42) 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: NewExtension(property1='something', property2=4) diff --git a/stix2/test/v20/test_datastore_filesystem.py b/stix2/test/v20/test_datastore_filesystem.py index c1d8f66..8fd45cf 100644 --- a/stix2/test/v20/test_datastore_filesystem.py +++ b/stix2/test/v20/test_datastore_filesystem.py @@ -421,7 +421,7 @@ def test_filesystem_object_with_custom_property(fs_store): x_empire="Roman", allow_custom=True) - fs_store.add(camp, True) + fs_store.add(camp) camp_r = fs_store.get(camp.id) assert camp_r.id == camp.id diff --git a/stix2/test/v20/test_datastore_filters.py b/stix2/test/v20/test_datastore_filters.py index 252b8eb..5ffd051 100644 --- a/stix2/test/v20/test_datastore_filters.py +++ b/stix2/test/v20/test_datastore_filters.py @@ -14,8 +14,7 @@ stix_objs = [ ], "modified": "2017-01-27T13:49:53.997Z", "name": "Poison Ivy", - "type": "malware", - "is_family": False + "type": "malware" }, { "created": "2014-05-08T09:00:00.000Z", diff --git a/stix2/test/v21/test_custom.py b/stix2/test/v21/test_custom.py index 57333db..6f0a68f 100644 --- a/stix2/test/v21/test_custom.py +++ b/stix2/test/v21/test_custom.py @@ -674,7 +674,7 @@ def test_custom_extension(): with pytest.raises(stix2.exceptions.MissingPropertiesError) as excinfo: NewExtension(property2=42) 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: NewExtension(property1='something', property2=4) diff --git a/stix2/test/v21/test_datastore_filesystem.py b/stix2/test/v21/test_datastore_filesystem.py index 85e6000..8393b59 100644 --- a/stix2/test/v21/test_datastore_filesystem.py +++ b/stix2/test/v21/test_datastore_filesystem.py @@ -417,7 +417,7 @@ def test_filesystem_object_with_custom_property(fs_store): x_empire="Roman", allow_custom=True) - fs_store.add(camp, True) + fs_store.add(camp) camp_r = fs_store.get(camp.id) assert camp_r.id == camp.id