Convert Python qlref tests to inline expectations

This commit is contained in:
Owen Mansel-Chan
2026-06-15 11:06:48 +01:00
parent d6ade8fe95
commit 0c2df7c7e9
475 changed files with 1612 additions and 1382 deletions

View File

@@ -2,19 +2,19 @@ from tempfile import mktemp
import os
def write_results1(results):
filename = mktemp()
filename = mktemp() # $ Alert
with open(filename, "w+") as f:
f.write(results)
print("Results written to", filename)
def write_results2(results):
filename = os.tempnam()
filename = os.tempnam() # $ Alert
with open(filename, "w+") as f:
f.write(results)
print("Results written to", filename)
def write_results3(results):
filename = os.tmpnam()
filename = os.tmpnam() # $ Alert
with open(filename, "w+") as f:
f.write(results)
print("Results written to", filename)

View File

@@ -1 +1,2 @@
Security/CWE-377/InsecureTemporaryFile.ql
query: Security/CWE-377/InsecureTemporaryFile.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql