Fix JSON encoding issue within tests

master
Desai, Kartikey H 2019-07-01 15:41:44 -04:00
parent c98fcafb1a
commit ffbf5fa34c
4 changed files with 5 additions and 4 deletions

View File

@ -32,7 +32,7 @@ EXPECTED_BUNDLE = """{
"malware_types": [
"ransomware"
],
"is_family": False
"is_family": "False"
},
{
"type": "relationship",

View File

@ -220,7 +220,7 @@ def test_parse_malware():
"malware_types": [
"ransomware"
],
"is_family": False
"is_family": "False"
}"""
mal = env.parse(data, version="2.1")

View File

@ -99,7 +99,7 @@ def test_indicator_required_properties():
assert excinfo.value.cls == stix2.v21.Indicator
assert excinfo.value.properties == ["indicator_types", "pattern", "valid_from"]
assert str(excinfo.value) == "No values for required properties for Indicator: (indicator_types, pattern)."
assert str(excinfo.value) == "No values for required properties for Indicator: (indicator_types, pattern, valid_from)."
def test_indicator_required_property_pattern():
@ -194,6 +194,7 @@ def test_invalid_indicator_pattern():
stix2.v21.Indicator(
indicator_types=['malicious-activity'],
pattern='[file:hashes.MD5 = "d41d8cd98f00b204e9800998ecf8427e"]',
valid_from="2017-01-01T12:34:56Z",
)
assert excinfo.value.cls == stix2.v21.Indicator
assert excinfo.value.prop_name == 'pattern'

View File

@ -18,7 +18,7 @@ EXPECTED_MALWARE = """{
"malware_types": [
"ransomware"
],
"is_family": False
"is_family": "False"
}"""