from stackgo.scripts import build_stack_dataset def test_dry_run_builds_all_stages(tmp_path, monkeypatch): calls = [] monkeypatch.setattr(build_stack_dataset, "_run", lambda name, command, dry_run: calls.append((name, command))) monkeypatch.setattr("sys.argv", [ "build-stack-dataset", "--index-dir", str(tmp_path / "index"), "--output", str(tmp_path / "dataset"), "--filtered-index-dir", str(tmp_path / "filtered"), "--content-dir", str(tmp_path / "contents"), "--min-stars-exclusive", "5", "--max-stars-exclusive", "11", "--skip-index-download", "--max-source-shards", "1", "--max-files", "3", "--with-samples", "--jobs", "2", "--dry-run", ]) build_stack_dataset.main() assert [name for name, _ in calls] == ["filter", "contents", "export", "samples"] export_command = calls[2][1] assert "--star-events-count-exclusive" in export_command assert "--star-events-count-max-exclusive" in export_command assert "11" in export_command