def test_validate_two_stix_sigs_at_once(): # arrange verdict = Verdict().set_malware_family("Eicar") # act verdict.add_stix_signatures([ ('oasis-open/cti-stix2-json-schemas/master/schemas/common/hex.json', "a0"), ('oasis-open/cti-stix2-json-schemas/master/schemas/common/kill-chain-phase.json', { "kill_chain_name": 'asdf', "phase_name": "full" }) ]) # assert assert Verdict.validate(json.loads(verdict.json()))
def test_add_two_stix_sigs_at_once(): # arrange verdict = Verdict() # act verdict.add_stix_signatures([ ('oasis-open/cti-stix2-json-schemas/master/schemas/common/hex.json', "a0"), ('oasis-open/cti-stix2-json-schemas/master/schemas/common/kill-chain-phase.json', { "kill_chain_name": 'asdf', "phase_name": "full" }) ]) # assert assert verdict.stix[0][ 'schema'] == 'oasis-open/cti-stix2-json-schemas/master/schemas/common/hex.json' assert verdict.stix[0]['signature'] == "a0" assert verdict.stix[1][ 'schema'] == 'oasis-open/cti-stix2-json-schemas/master/schemas/common/kill-chain-phase.json' assert verdict.stix[1]['signature'] == { "kill_chain_name": 'asdf', "phase_name": "full" }