-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest.py
More file actions
22 lines (18 loc) · 834 Bytes
/
test.py
File metadata and controls
22 lines (18 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import subprocess
import os
##setting file path variables
script_path = "../../tasks/code_completion/eval.py"
arguments = ["--answers", "answers.txt",
"--predictions", "predictions.txt"]
with open("output.txt", "w") as f:
subprocess.run(["python", script_path] + arguments, stderr=f)
# Check if the text in the output.txt file matches the text in the expected.txt file
with open("output.txt", "r") as f_output, open("expected.txt", "r") as f_expected:
output_content = f_output.read()
expected_content = f_expected.read()
if output_content == expected_content:
print("The text in output.txt matches the text in expected.txt.")
else:
print("The text in output.txt does not match the text in expected.txt.")
# Delete the output.txt file
os.remove("output.txt")