Changes from add-trailing-comma hook
parent
68f93f4110
commit
c6132537b8
|
@ -1,11 +1,11 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import stix2.exceptions
|
import stix2.exceptions
|
||||||
import stix2.utils
|
import stix2.utils
|
||||||
import stix2.v21
|
import stix2.v21
|
||||||
|
|
||||||
|
|
||||||
MALWARE_ANALYSIS_JSON = """{
|
MALWARE_ANALYSIS_JSON = """{
|
||||||
"type": "malware-analysis",
|
"type": "malware-analysis",
|
||||||
"spec_version": "2.1",
|
"spec_version": "2.1",
|
||||||
|
@ -49,10 +49,12 @@ def test_malware_analysis_example():
|
||||||
assert str(ma) == MALWARE_ANALYSIS_JSON
|
assert str(ma) == MALWARE_ANALYSIS_JSON
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("data", [
|
@pytest.mark.parametrize(
|
||||||
MALWARE_ANALYSIS_JSON,
|
"data", [
|
||||||
MALWARE_ANALYSIS_DICT
|
MALWARE_ANALYSIS_JSON,
|
||||||
])
|
MALWARE_ANALYSIS_DICT,
|
||||||
|
],
|
||||||
|
)
|
||||||
def test_parse_malware_analysis(data):
|
def test_parse_malware_analysis(data):
|
||||||
ma = stix2.parse(data, version="2.1")
|
ma = stix2.parse(data, version="2.1")
|
||||||
|
|
||||||
|
@ -76,5 +78,5 @@ def test_parse_malware_analysis(data):
|
||||||
def test_malware_analysis_constraint():
|
def test_malware_analysis_constraint():
|
||||||
with pytest.raises(stix2.exceptions.AtLeastOnePropertyError):
|
with pytest.raises(stix2.exceptions.AtLeastOnePropertyError):
|
||||||
stix2.v21.MalwareAnalysis(
|
stix2.v21.MalwareAnalysis(
|
||||||
product="Acme Malware Analyzer"
|
product="Acme Malware Analyzer",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue