Move a couple tests for organization

pull/1/head
Chris Lenk 2020-06-18 08:58:00 -04:00
parent b2ee33208f
commit b42b1cafa7
2 changed files with 24 additions and 24 deletions

View File

@ -288,6 +288,18 @@ def test_custom_marking_no_init_2():
assert no2.property1 == 'something' assert no2.property1 == 'something'
def test_register_duplicate_marking():
with pytest.raises(DuplicateRegistrationError) as excinfo:
@stix2.v20.CustomMarking(
'x-new-obj2', [
('property1', stix2.properties.StringProperty(required=True)),
],
)
class NewObj2():
pass
assert "cannot be registered again" in str(excinfo.value)
@stix2.v20.CustomObject( @stix2.v20.CustomObject(
'x-new-type', [ 'x-new-type', [
('property1', stix2.properties.StringProperty(required=True)), ('property1', stix2.properties.StringProperty(required=True)),
@ -1119,15 +1131,3 @@ def test_register_duplicate_observable_extension():
class NewExtension2(): class NewExtension2():
pass pass
assert "cannot be registered again" in str(excinfo.value) assert "cannot be registered again" in str(excinfo.value)
def test_register_duplicate_marking():
with pytest.raises(DuplicateRegistrationError) as excinfo:
@stix2.v20.CustomMarking(
'x-new-obj-2', [
('property1', stix2.properties.StringProperty(required=True)),
],
)
class NewObj2():
pass
assert "cannot be registered again" in str(excinfo.value)

View File

@ -397,6 +397,18 @@ def test_custom_marking_invalid_type_name():
pass # pragma: no cover pass # pragma: no cover
assert "Invalid type name '7x-new-marking':" in str(excinfo.value) assert "Invalid type name '7x-new-marking':" 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)
# Custom Objects # Custom Objects
@ -1326,15 +1338,3 @@ def test_register_duplicate_observable_extension():
class NewExtension2(): class NewExtension2():
pass pass
assert "cannot be registered again" in str(excinfo.value) 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)