Skip to content

Commit 1d0e061

Browse files
Initialise reimporter accumulators in duplicate reactivation tests
process_matched_mitigated_finding appends to self.reactivated_items, which is normally created in process_findings(). The tests drive the method directly, so set the accumulator lists explicitly.
1 parent 6138824 commit 1d0e061

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

unittests/test_importers_importer.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,11 @@ def test_reactivation_keeps_duplicate_inactive_and_unverified(self):
994994
verified=True,
995995
do_not_reactivate=False,
996996
)
997+
# These accumulators are normally initialised inside process_findings(); set them
998+
# here because the test drives process_matched_mitigated_finding() directly.
999+
reimporter.new_items = []
1000+
reimporter.reactivated_items = []
1001+
reimporter.unchanged_items = []
9971002

9981003
result_finding, _ = reimporter.process_matched_mitigated_finding(unsaved_finding, existing_duplicate)
9991004

@@ -1026,6 +1031,11 @@ def test_reactivation_of_non_duplicate_still_activates(self):
10261031
verified=True,
10271032
do_not_reactivate=False,
10281033
)
1034+
# These accumulators are normally initialised inside process_findings(); set them
1035+
# here because the test drives process_matched_mitigated_finding() directly.
1036+
reimporter.new_items = []
1037+
reimporter.reactivated_items = []
1038+
reimporter.unchanged_items = []
10291039

10301040
result_finding, _ = reimporter.process_matched_mitigated_finding(unsaved_finding, existing)
10311041

0 commit comments

Comments
 (0)