Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

test(plugin): check the Windows draft symlink diagnostic (#2369)

Michael D'Angelo06682247d0f0
diff --git a/plugins/codex-security/tests/test_workbench_draft_publication.py b/plugins/codex-security/tests/test_workbench_draft_publication.py
index 3b70729a3..3379a832c 100644
--- a/plugins/codex-security/tests/test_workbench_draft_publication.py
+++ b/plugins/codex-security/tests/test_workbench_draft_publication.py
@@ -4,6 +4,7 @@ from __future__ import annotations
import hashlib
import json
+import os
import uuid
from pathlib import Path
@@ -40,6 +41,7 @@ def stage_model_draft(tmp_path, scan_dir, scan_id, target, model, *, complete=Tr
return documents, staged
@pytest.mark.parametrize("filename", ["findings.json", "coverage.json"])
@pytest.mark.parametrize("previous", ["unfinished", "symlink"])
def test_terminal_deep_draft_compares_previous_bytes_without_parsing_review_documents(
@@ -66,7 +68,12 @@ def test_terminal_deep_draft_compares_previous_bytes_without_parsing_review_docu
check=False,
)
assert rejected["returncode"] != 0
- assert "expected a file inside the scan directory" in str(rejected["stderr"])
+ expected = (
+ "scan-local files must not be reparse points"
+ if os.name == "nt"
+ else "expected a file inside the scan directory"
+ )
+ assert expected in str(rejected["stderr"])
assert old_document.is_symlink()
assert outside.read_text() == "unfinished review document"
return