-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
29 lines (26 loc) · 830 Bytes
/
test.py
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
from tools.test_util import *
from sys import argv
import os
def help():
print("Expected args: python test.py (name_of_file.pylambda | name_of_folder) [--err]")
def main():
if len(argv) < 2:
help()
return
if os.path.isdir(argv[1]):
for filename in os.listdir(argv[1]):
filepath = f"{argv[1]}/{filename}"
if os.path.isdir(filepath):
continue
if not test_file(filepath):
print(f"Failure in file {filename}")
return
print(f"{filepath} run successfully")
print(f"Tests run successfully on directory {argv[1]}")
return
if not test_file(argv[1]):
print(f"Failure in file {argv[1]}")
else:
print(f"{argv[1]} run successfully")
if __name__=="__main__":
main()