def test_malware_versionning():
    """Tests that a getting a Malware object returns the most recent version."""
    malware = Malware(name='asd', labels=['label1'])
    malware.save()
    stix_id = malware.id
    malware.update({'name': 'dsa'})
    fetched = Malware.get(stix_id)
    assert fetched.id == stix_id
    assert fetched.created < fetched.modified
Exemple #2
0
def test_malware_fetch():
    """Tests creating a Malware object and saving it."""
    mal = Malware(name='Gootkit').save()
    fetched_mal = Malware.get(mal.id)
    assert isinstance(fetched_mal, Malware)
    assert fetched_mal.id == mal.id