-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_run_python_file.py
More file actions
37 lines (28 loc) · 906 Bytes
/
test_run_python_file.py
File metadata and controls
37 lines (28 loc) · 906 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
from functions.run_python_file import run_python_file
def test():
result = run_python_file("calculator", "main.py")
print("Result for 'main.py':")
print(result)
print("")
result = run_python_file("calculator", "main.py", ["3 + 5"])
print("Result for 'main.py' with '3 + 5' as arguments :")
print(result)
print("")
result = run_python_file("calculator", "tests.py")
print("Result for 'tests.py':")
print(result)
print("")
result = run_python_file("calculator", "../main.py")
print("Result for '../main.py':")
print(result)
print("")
result = run_python_file("calculator", "nonexistent.py")
print("Result for '../nonexistent.py':")
print(result)
print("")
result = run_python_file("calculator", "lorem.txt")
print("Result for 'lorem.txt':")
print(result)
print("")
if __name__ == "__main__":
test()