-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
27 lines (22 loc) · 740 Bytes
/
tests.py
File metadata and controls
27 lines (22 loc) · 740 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
from functions.run_python_file import run_python_file
def print_with_red(*args, **kwargs):
print('\033[31m')
print(*args, **kwargs)
print('\033[0m')
test_calls = [
(run_python_file, "calculator", "main.py"),
(run_python_file, "calculator", "tests.py"),
(run_python_file, "calculator", "../main.py"),
(run_python_file, "calculator", "nonexistent.py"),
]
def main():
for func, param1, param2 in test_calls:
print_with_red('=====================\n')
print(func.__name__)
print('working_directory =', param1)
print('file_path =', param2)
print('Results:\n')
print(func(param1, param2))
print_with_red('=====================\n')
if __name__ == "__main__":
main()