Skip to content

Commit 32e1543

Browse files
Fix test failures
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent 0530bbe commit 32e1543

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

scanpipe/tests/pipes/test_flag.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ def test_scanpipe_pipes_flag_flag_ignored_patterns(self):
100100
project2, "a.cdx.json.zip-extract/__MACOSX/._a.cdx.json"
101101
)
102102
make_resource_file(project2, "a.cdx.json.zip-extract/a.cdx.json")
103-
updated = flag.flag_ignored_patterns(project2, flag.DEFAULT_IGNORED_PATTERNS)
103+
updated = flag.flag_ignored_patterns(
104+
project2.codebaseresources.no_status(), flag.DEFAULT_IGNORED_PATTERNS
105+
)
104106
self.assertEqual(2, updated)
105107
ignored_qs = project2.codebaseresources.status(flag.IGNORED_PATTERN)
106108
self.assertEqual(2, ignored_qs.count())

scanpipe/tests/test_pipelines.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,11 @@ def test_scanpipe_pipeline_class_flag_ignored_resources(self):
422422
with mock.patch("scanpipe.pipes.flag.flag_ignored_patterns") as mock_flag:
423423
mock_flag.return_value = None
424424
pipeline.flag_ignored_resources()
425+
426+
mock_flag.assert_called_once()
425427
patterns_args = ["*.ext", *flag.DEFAULT_IGNORED_PATTERNS]
426-
mock_flag.assert_called_with(
427-
codebaseresources=project1.codebaseresources.no_status(),
428-
patterns=patterns_args,
429-
)
428+
self.assertEqual(mock_flag.mock_calls[0].kwargs["patterns"], patterns_args)
429+
self.assertEqual(mock_flag.mock_calls[0].kwargs["codebaseresources"].count(), 0)
430430

431431
def test_scanpipe_pipeline_class_extract_archive(self):
432432
project1 = Project.objects.create(name="Analysis")

0 commit comments

Comments
 (0)