Add test to ensure fix. Fixes #248
parent
e748923f19
commit
84fc71add4
|
@ -35,6 +35,22 @@ def test_malware_with_all_required_properties():
|
|||
assert str(mal) == EXPECTED_MALWARE
|
||||
|
||||
|
||||
def test_malware_with_empty_optional_field():
|
||||
now = dt.datetime(2016, 5, 12, 8, 17, 27, tzinfo=pytz.utc)
|
||||
|
||||
mal = stix2.v20.Malware(
|
||||
type="malware",
|
||||
id=MALWARE_ID,
|
||||
created=now,
|
||||
modified=now,
|
||||
labels=["ransomware"],
|
||||
name="Cryptolocker",
|
||||
external_references=[],
|
||||
)
|
||||
|
||||
assert str(mal) == EXPECTED_MALWARE
|
||||
|
||||
|
||||
def test_malware_autogenerated_properties(malware):
|
||||
assert malware.type == 'malware'
|
||||
assert malware.id == 'malware--00000000-0000-4000-8000-000000000001'
|
||||
|
|
Loading…
Reference in New Issue