@@ -10,15 +10,15 @@ def test_split_bundle():
10
10
stix_splitter = OpenCTIStix2Splitter ()
11
11
with open ("./tests/data/enterprise-attack.json" ) as file :
12
12
content = file .read ()
13
- expectations , bundles = stix_splitter .split_bundle_with_expectations (content )
13
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (content )
14
14
assert expectations == 7016
15
15
16
16
17
17
def test_split_test_bundle ():
18
18
stix_splitter = OpenCTIStix2Splitter ()
19
19
with open ("./tests/data/DATA-TEST-STIX2_v2.json" ) as file :
20
20
content = file .read ()
21
- expectations , bundles = stix_splitter .split_bundle_with_expectations (content )
21
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (content )
22
22
assert expectations == 59
23
23
base_bundles = json .loads (content )["objects" ]
24
24
for base in base_bundles :
@@ -40,13 +40,13 @@ def test_split_mono_entity_bundle():
40
40
stix_splitter = OpenCTIStix2Splitter ()
41
41
with open ("./tests/data/mono-bundle-entity.json" ) as file :
42
42
content = file .read ()
43
- expectations , bundles = stix_splitter .split_bundle_with_expectations (content )
43
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (content )
44
44
assert expectations == 1
45
45
json_bundle = json .loads (bundles [0 ])["objects" ][0 ]
46
46
assert json_bundle ["created_by_ref" ] == "fa42a846-8d90-4e51-bc29-71d5b4802168"
47
47
# Split with cleanup_inconsistent_bundle
48
48
stix_splitter = OpenCTIStix2Splitter ()
49
- expectations , bundles = stix_splitter .split_bundle_with_expectations (
49
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (
50
50
bundle = content , cleanup_inconsistent_bundle = True
51
51
)
52
52
assert expectations == 1
@@ -58,11 +58,11 @@ def test_split_mono_relationship_bundle():
58
58
stix_splitter = OpenCTIStix2Splitter ()
59
59
with open ("./tests/data/mono-bundle-relationship.json" ) as file :
60
60
content = file .read ()
61
- expectations , bundles = stix_splitter .split_bundle_with_expectations (content )
61
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (content )
62
62
assert expectations == 1
63
63
# Split with cleanup_inconsistent_bundle
64
64
stix_splitter = OpenCTIStix2Splitter ()
65
- expectations , bundles = stix_splitter .split_bundle_with_expectations (
65
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (
66
66
bundle = content , cleanup_inconsistent_bundle = True
67
67
)
68
68
assert expectations == 0
@@ -72,19 +72,19 @@ def test_split_capec_bundle():
72
72
stix_splitter = OpenCTIStix2Splitter ()
73
73
with open ("./tests/data/mitre_att_capec.json" ) as file :
74
74
content = file .read ()
75
- expectations , bundles = stix_splitter .split_bundle_with_expectations (content )
75
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (content )
76
76
assert expectations == 2610
77
77
78
78
79
79
def test_split_internal_ids_bundle ():
80
80
stix_splitter = OpenCTIStix2Splitter ()
81
81
with open ("./tests/data/bundle_with_internal_ids.json" ) as file :
82
82
content = file .read ()
83
- expectations , bundles = stix_splitter .split_bundle_with_expectations (content )
83
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (content )
84
84
assert expectations == 4
85
85
# Split with cleanup_inconsistent_bundle
86
86
stix_splitter = OpenCTIStix2Splitter ()
87
- expectations , bundles = stix_splitter .split_bundle_with_expectations (
87
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (
88
88
bundle = content , cleanup_inconsistent_bundle = True
89
89
)
90
90
assert expectations == 4
@@ -101,11 +101,11 @@ def test_split_missing_refs_bundle():
101
101
stix_splitter = OpenCTIStix2Splitter ()
102
102
with open ("./tests/data/missing_refs.json" ) as file :
103
103
content = file .read ()
104
- expectations , bundles = stix_splitter .split_bundle_with_expectations (content )
104
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (content )
105
105
assert expectations == 4
106
106
# Split with cleanup_inconsistent_bundle
107
107
stix_splitter = OpenCTIStix2Splitter ()
108
- expectations , bundles = stix_splitter .split_bundle_with_expectations (
108
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (
109
109
bundle = content , cleanup_inconsistent_bundle = True
110
110
)
111
111
assert expectations == 3
@@ -115,7 +115,7 @@ def test_split_cyclic_bundle():
115
115
stix_splitter = OpenCTIStix2Splitter ()
116
116
with open ("./tests/data/cyclic-bundle.json" ) as file :
117
117
content = file .read ()
118
- expectations , bundles = stix_splitter .split_bundle_with_expectations (content )
118
+ expectations , _ , bundles = stix_splitter .split_bundle_with_expectations (content )
119
119
assert expectations == 6
120
120
for bundle in bundles :
121
121
json_bundle = json .loads (bundle )
0 commit comments