mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
fix(tests): use exact-equality check to clear CodeQL substring-URL false positive (#1183)
CodeQL (py/incomplete-url-substring-sanitization) flagged the "https://schema.org/" in flattened check because it pattern-matches on URL-ish strings tested with `in`. flattened is always a list here, so the check was already exact membership, not a substring test on untrusted input, but the ambiguous idiom tripped the scanner. Rewrite as an explicit equality comparison so the intent is unambiguous.
This commit is contained in:
@@ -160,7 +160,7 @@ def test_a_url_valued_context_is_not_thrown_away(tmp_path):
|
||||
context = json.loads(path.read_text())["@context"]
|
||||
|
||||
flattened = context if isinstance(context, list) else [context]
|
||||
assert "https://schema.org/" in flattened, (
|
||||
assert any(entry == "https://schema.org/" for entry in flattened), (
|
||||
"the caller's context was replaced by Semantica's defaults, "
|
||||
"which silently changes how every term expands"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user