modify test to cover exception message

master
Emmanuelle Vargas-Gonzalez 2019-05-03 11:05:32 -04:00
parent b3a601e4c8
commit 4b21708e03
2 changed files with 6 additions and 2 deletions

View File

@ -71,13 +71,15 @@ def test_bad_created_marking_tlp_amber():
def test_bad_created_marking_tlp_red():
with pytest.raises(exceptions.TLPMarkingDefinitionError):
with pytest.raises(exceptions.TLPMarkingDefinitionError) as excinfo:
MarkingDefinition(
id='marking-definition--5e57c739-391a-4eb3-b6be-7d15ca92d5ed',
definition_type='tlp',
definition=TLPMarking(tlp='red'),
)
assert "marking-definition--5e57c739-391a-4eb3-b6be-7d15ca92d5ed" in str(excinfo.value)
def test_successful_tlp_white():
white = MarkingDefinition(

View File

@ -71,13 +71,15 @@ def test_bad_created_marking_tlp_amber():
def test_bad_created_marking_tlp_red():
with pytest.raises(exceptions.TLPMarkingDefinitionError):
with pytest.raises(exceptions.TLPMarkingDefinitionError) as excinfo:
MarkingDefinition(
id='marking-definition--5e57c739-391a-4eb3-b6be-7d15ca92d5ed',
definition_type='tlp',
definition=TLPMarking(tlp='red'),
)
assert "marking-definition--5e57c739-391a-4eb3-b6be-7d15ca92d5ed" in str(excinfo.value)
def test_successful_tlp_white():
white = MarkingDefinition(