-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_run_python_file.py
More file actions
47 lines (45 loc) · 945 Bytes
/
test_run_python_file.py
File metadata and controls
47 lines (45 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from functions.run_python_file import run_python_file
test_input = [
(
"Result for running main.py:",
"calculator",
"main.py",
None,
),
(
"Result for running main.py '3 + 5':",
"calculator",
"main.py",
["3 + 5"],
),
(
"Result for running tests.py:",
"calculator",
"tests.py",
None,
),
(
"Result for running ../main.py:",
"calculator",
"../main.py",
None,
),
(
"Results for running nonexistent.py:",
"calculator",
"nonexistent.py",
None,
),
(
"Results for running lorem.txt:",
"calculator",
"lorem.txt",
None,
),
]
for test in test_input:
status, working_dir, filename, args = test
print(status)
result = run_python_file(working_dir, filename, args)
if result:
print(f"{result}")