Add test to ensure fix. Fixes #248

master
Desai, Kartikey H 2019-04-19 12:17:42 -04:00
parent e748923f19
commit 84fc71add4
1 changed files with 16 additions and 0 deletions

View File

@ -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'