Update ImmutableError test cases.
parent
fceef4d85a
commit
d579c12172
|
@ -129,7 +129,7 @@ def test_cannot_assign_to_indicator_attributes(indicator):
|
|||
with pytest.raises(stix2.exceptions.ImmutableError) as excinfo:
|
||||
indicator.valid_from = dt.datetime.now()
|
||||
|
||||
assert str(excinfo.value) == "Cannot modify 'valid_from' property in <class 'stix2.sdo.Indicator'> after creation."
|
||||
assert str(excinfo.value) == "Cannot modify 'valid_from' property in 'Indicator' after creation."
|
||||
|
||||
|
||||
def test_invalid_kwarg_to_indicator():
|
||||
|
|
|
@ -92,7 +92,7 @@ def test_cannot_assign_to_malware_attributes(malware):
|
|||
with pytest.raises(stix2.exceptions.ImmutableError) as excinfo:
|
||||
malware.name = "Cryptolocker II"
|
||||
|
||||
assert str(excinfo.value) == "Cannot modify 'name' property in <class 'stix2.sdo.Malware'> after creation."
|
||||
assert str(excinfo.value) == "Cannot modify 'name' property in 'Malware' after creation."
|
||||
|
||||
|
||||
def test_invalid_kwarg_to_malware():
|
||||
|
|
|
@ -103,7 +103,7 @@ def test_cannot_assign_to_relationship_attributes(relationship):
|
|||
with pytest.raises(stix2.exceptions.ImmutableError) as excinfo:
|
||||
relationship.relationship_type = "derived-from"
|
||||
|
||||
assert str(excinfo.value) == "Cannot modify 'relationship_type' property in <class 'stix2.sro.Relationship'> after creation."
|
||||
assert str(excinfo.value) == "Cannot modify 'relationship_type' property in 'Relationship' after creation."
|
||||
|
||||
|
||||
def test_invalid_kwarg_to_relationship():
|
||||
|
|
Loading…
Reference in New Issue