Skip to content

Commit 63d808b

Browse files
committed
fix: Update test to mock hierarchy_builder component correctly
The test was mocking the old wrapper method (mock_diffstix.get_parent_stix_object) but calling the new component method (mock_diffstix.hierarchy_builder.get_parent_stix_object). Changed to mock the correct component method to fix the test failure.
1 parent 760d1ab commit 63d808b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/changelog/integration/test_diffstix_data_processing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ def test_get_parent_stix_object(self, mock_diffstix, sample_technique_object, sa
1212
"T1234.001": sample_subtechnique_object,
1313
}
1414

15-
# Mock the actual DiffStix method
15+
# Mock the hierarchy_builder method
1616
def mock_get_parent(subtechnique, _version, _domain):
1717
if subtechnique.get("external_references", [{}])[0].get("external_id") == "T1234.001":
1818
return sample_technique_object
1919
return None
2020

21-
mock_diffstix.get_parent_stix_object = mock_get_parent
21+
mock_diffstix.hierarchy_builder.get_parent_stix_object = mock_get_parent
2222

2323
# Test finding parent
2424
parent = mock_diffstix.hierarchy_builder.get_parent_stix_object(sample_subtechnique_object, "old", "enterprise-attack")

0 commit comments

Comments
 (0)