From 62ee2b2b0a4c489e358e93d58d639bc99d63a586 Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Mon, 6 Jul 2020 22:43:25 -0400 Subject: [PATCH] Pre-commit changes. Also remove a dupe test function which slipped through due to a rather complex rebase... not too surprising I missed it. --- stix2/test/test_properties.py | 3 +-- stix2/test/v20/test_properties.py | 5 ++--- stix2/test/v21/test_custom.py | 12 ------------ 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/stix2/test/test_properties.py b/stix2/test/test_properties.py index 60a42e6..ea9a003 100644 --- a/stix2/test/test_properties.py +++ b/stix2/test/test_properties.py @@ -3,10 +3,9 @@ import datetime as dt import pytest import pytz -import stix2 from stix2.base import _STIXBase from stix2.exceptions import ( - ExtraPropertiesError, STIXError, CustomContentError, + CustomContentError, ExtraPropertiesError, STIXError, ) from stix2.properties import ( BinaryProperty, BooleanProperty, EmbeddedObjectProperty, EnumProperty, diff --git a/stix2/test/v20/test_properties.py b/stix2/test/v20/test_properties.py index 4dbc437..0158f9a 100644 --- a/stix2/test/v20/test_properties.py +++ b/stix2/test/v20/test_properties.py @@ -9,14 +9,13 @@ from stix2.exceptions import ( ) from stix2.properties import ( DictionaryProperty, EmbeddedObjectProperty, ExtensionsProperty, - HashesProperty, ListProperty, ObservableProperty, ReferenceProperty, - STIXObjectProperty, IDProperty, + HashesProperty, IDProperty, ListProperty, ObservableProperty, + ReferenceProperty, STIXObjectProperty, ) from stix2.v20.common import MarkingProperty from . import constants - ID_PROP = IDProperty('my-type', spec_version="2.0") MY_ID = 'my-type--232c9d3f-49fc-4440-bb01-607f638778e7' diff --git a/stix2/test/v21/test_custom.py b/stix2/test/v21/test_custom.py index 1f86a27..e51d76a 100644 --- a/stix2/test/v21/test_custom.py +++ b/stix2/test/v21/test_custom.py @@ -1414,18 +1414,6 @@ def test_register_duplicate_observable_extension(): assert "cannot be registered again" in str(excinfo.value) -def test_register_duplicate_marking(): - with pytest.raises(DuplicateRegistrationError) as excinfo: - @stix2.v21.CustomMarking( - 'x-new-obj', [ - ('property1', stix2.properties.StringProperty(required=True)), - ], - ) - class NewObj2(): - pass - assert "cannot be registered again" in str(excinfo.value) - - def test_allow_custom_propagation(): obj_dict = { "type": "bundle",