Skip to content

Commit 697e2d3

Browse files
committed
Restore explicit-files discovery test
The test checks that explicit files skip a second discovery walk. It failed only because its stub full scan had no html_report_url, which create_full_scan_with_report_url now reads.
1 parent d3b0c22 commit 697e2d3

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

‎tests/unit/test_manifest_discovery.py‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,31 @@ def test_results_are_sorted_and_deduplicated_across_overlapping_patterns(tmp_pat
282282
assert len(found) == 2
283283

284284

285+
def test_explicit_discovery_results_prevent_a_second_walk(tmp_path):
286+
manifest = tmp_path / "package.json"
287+
manifest.write_text("{}", encoding="utf-8")
288+
core = _make_core()
289+
core.config.org_slug = "example"
290+
core.cli_config = None
291+
core.find_files = MagicMock(side_effect=AssertionError("unexpected second walk"))
292+
core.create_full_scan = MagicMock(return_value=SimpleNamespace(id="scan-123", html_report_url=None))
293+
params = MagicMock()
294+
295+
diff = core.create_full_scan_with_report_url(
296+
[str(tmp_path)],
297+
params,
298+
explicit_files=[manifest.as_posix()],
299+
)
300+
301+
core.find_files.assert_not_called()
302+
core.create_full_scan.assert_called_once_with(
303+
[manifest.as_posix()],
304+
params,
305+
base_paths=None,
306+
)
307+
assert diff.id == "scan-123"
308+
309+
285310
def test_core_initialization_logs_organization_timing(caplog):
286311
sdk = MagicMock()
287312
sdk.org.get.return_value = {

0 commit comments

Comments
 (0)